Where to execute VBScript such as this one...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Chris Nebinger (anonymous_at_discussions.microsoft.com)
Date: 05/24/04


Date: Mon, 24 May 2004 10:11:58 -0700

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



Relevant Pages

  • Re: Member or Data Member not Found
    ... Microsoft introduced a new data access method in the late 90s known as ADO. ... Access 97 and previous only had DAO in them. ... You must disambiguate as Dim rst As DAO.Recordset. ...
    (microsoft.public.access.formscoding)
  • Re: Need help with a DAO to ADO conversion
    ... the open/close code of the DAO object. ... Dim wksCurr As DAO.Workspace ... Dim fldCurr As DAO.Field ... Set dbCurr = OpenDatabase ...
    (microsoft.public.access.formscoding)
  • Re: Refreshing subform
    ... the new data is added to the subform. ... I do not want to use DAO. ... >> Dim CurrConn As New ADODB.Connection ... >> Exit Sub ...
    (microsoft.public.access.formscoding)
  • Re: Address List
    ... DAO, so the lines that Duane has for ADO need to be commented out and the ... Dim rs As DAO.Recordset ... Dim strConcat As String 'build return string ... "John Spencer" wrote: ...
    (microsoft.public.access.queries)
  • Re: Moving ADO routine back to DAO
    ... Problems with missing DAO 3.6 references are not unheard of, ... non-trivial app, though. ... > I have a client running an app I developed ... > 110: Dim errloop As Error ...
    (microsoft.public.access.modulesdaovba)