How to run a script like the following to create tables? Thanks.
' Starting Access Basic DAO Session...
Dim ERwinWorkspace As Workspace
Dim ERwinDatabase As Database
Dim ERwinTableDef As TableDef
Dim ERwinQueryDef As QueryDef
Dim ERwinIndex As Index
Dim ERwinField As Field
Dim ERwinRelation As Relation
Set ERwinWorkspace = DBEngine.WorkSpaces(0)
Set ERwinDatabase = ERwinWorkspace.OpenDatabase(sERwinDatabase)
' CREATE TABLE "CUSTOMER"
Set ERwinTableDef = ERwinDatabase.CreateTableDef("CUSTOMER"
Set ERwinField = ERwinTableDef.CreateField("cust_id", DB_LONG)
ERwinField.Attributes = ERwinField.Attributes + DB_AUTOINCRFIELD
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_buss_name", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_first_name", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_last_name", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_addr", DB_TEXT, 30)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_city", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_state", DB_TEXT, 2)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_zip", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_tel", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_fax", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_mobil", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_email", DB_TEXT, 40)
ERwinTableDef.Fields.Append ERwinField
ERwinDatabase.TableDefs.Append ERwinTableDef
ERwinDatabase.Close
ERwinWorkspace.Close
' Terminating Access Basic DAO Session...
' Starting Access Basic DAO Session...
Dim ERwinWorkspace As Workspace
Dim ERwinDatabase As Database
Dim ERwinTableDef As TableDef
Dim ERwinQueryDef As QueryDef
Dim ERwinIndex As Index
Dim ERwinField As Field
Dim ERwinRelation As Relation
Set ERwinWorkspace = DBEngine.WorkSpaces(0)
Set ERwinDatabase = ERwinWorkspace.OpenDatabase(sERwinDatabase)
' CREATE TABLE "CUSTOMER"
Set ERwinTableDef = ERwinDatabase.CreateTableDef("CUSTOMER"
Set ERwinField = ERwinTableDef.CreateField("cust_id", DB_LONG)
ERwinField.Attributes = ERwinField.Attributes + DB_AUTOINCRFIELD
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_buss_name", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_first_name", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_last_name", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_addr", DB_TEXT, 30)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_city", DB_TEXT, 20)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_state", DB_TEXT, 2)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_zip", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_tel", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_fax", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_mobil", DB_INTEGER)
ERwinTableDef.Fields.Append ERwinField
Set ERwinField = ERwinTableDef.CreateField("cust_email", DB_TEXT, 40)
ERwinTableDef.Fields.Append ERwinField
ERwinDatabase.TableDefs.Append ERwinTableDef
ERwinDatabase.Close
ERwinWorkspace.Close
' Terminating Access Basic DAO Session...