CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Linking Tables

  1. #1
    Guest

    Linking Tables

    How can I link ACCESS Database tables in VB5 using DAO.


  2. #2
    Join Date
    Dec 1999
    Location
    India
    Posts
    3

    Re: Linking Tables

    Use Relation Object , Relations collection and its properties and methods to link tables in runtime


    Sample code from VB Help
    ' Create EmployeesDepartments Relation object, using
    ' the names of the two tables in the relation.
    Set relNew = .CreateRelation("EmployeesDepartments", _
    tdfNew.Name, tdfEmployees.Name, _

    dbRelationUpdateCascade)

    ' Create Field object for the Fields collection of the
    ' new Relation object. Set the Name and ForeignName
    ' properties based on the fields to be used for the
    ' relation.
    relNew.Fields.Append relNew.CreateField("DeptID")
    relNew.Fields!DeptID.ForeignName = "DeptID"
    .Relations.Append relNew




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured