-
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.
-
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