Results 1 to 2 of 2

Thread: Sychronise Database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Taipei
    Posts
    318

    Post

    I have 2 access97 database, A & B, in which B is a newer version having more tables that A do not has and some more fields in tables which A also has. The question is : How I can update the layout of A so that A and B is identical in their layout. I would appreciate a lot if somebody can help me on this.

  2. #2
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Post

    Hello kmchong,

    With next source you can change the structure of your database:

    Private Sub Form_Load()
    Dim tdfNew As TableDef
    Dim ProjectsWS As Workspace
    Dim ProjectsDB As Database

    Set ProjectsWS = DBEngine.Workspaces(0)
    Set ProjectsDB = ProjectsWS.OpenDatabase("c:\YourDB.mdb")

    Set tdfNew = ProjectsDB.CreateTableDef("Vendor")
    With tdfNew
    .Fields.Append .CreateField("Number", dbInteger)
    .Fields.Append .CreateField("VendorName", dbText)
    End With

    ProjectsDB.TableDefs.Append tdfNew
    ProjectsDB.Close
    End Sub

    Success,

    michelle

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