Where to execute VBScript such as this one...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create tables using sample scripts below... could someone point me to where I could populate this into Access DB
Much Appreciated
-Lawrenc

Dim ERwinWorkspace As Workspac
Dim ERwinDatabase As Databas
Dim ERwinTableDef As TableDe
Dim ERwinField As Fiel
Dim ERwinRelation As Relatio
Set ERwinWorkspace = DBEngine.Workspaces(0
Set ERwinDatabase = ERwinWorkspace.OpenDatabase(sERwinDatabase
' DELETE TABLE "F_Operating_Expense
ERwinDatabase.TableDefs.Delete "F_Operating_Expense
' CREATE TABLE "F_Operating_Expense
Set ERwinTableDef = ERwinDatabase.CreateTableDef("F_Operating_Expense"
Set ERwinField = ERwinTableDef.CreateField("f_operating_expense_id", DB_INTEGER
 
You can put the following code in any module, in a
subroutine

Public Sub CreateTables()
Dim ErwinWorkspace as Workspace
....



End Sub

Just a note: You are using DAO. If you are adding this
to a Access 2000 or greater database, DAO will not be
selected by default. Go into a module, then select Tools-
References and uncheck the Microsoft Access Data Object
and select Microsoft DAO 4.0 (or whatever version you have)



Chris Nebinger

-----Original Message-----
I am trying to create tables using sample scripts
below... could someone point me to where I could populate
this into Access DB.
Much Appreciated!
-Lawrence

Dim ERwinWorkspace As Workspace
Dim ERwinDatabase As Database
Dim ERwinTableDef As TableDef
Dim ERwinField As Field
Dim ERwinRelation As Relation
Set ERwinWorkspace = DBEngine.Workspaces(0)
Set ERwinDatabase = ERwinWorkspace.OpenDatabase (sERwinDatabase)
' DELETE TABLE "F_Operating_Expense"
ERwinDatabase.TableDefs.Delete "F_Operating_Expense"
' CREATE TABLE "F_Operating_Expense"
Set ERwinTableDef = ERwinDatabase.CreateTableDef ("F_Operating_Expense")
Set ERwinField = ERwinTableDef.CreateField
("f_operating_expense_id", DB_INTEGER)
 
Back
Top