Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Structure only arument (Access 2000)

    I use a function for copying all the tables from a database.Can i add on an argument to copy Structure Only tables?
    Below is the function i use
    Public Function ImportAllTables(DBName)
    Dim Strpassword As String
    Strpassword = "secret"
    Dim db As DAO.Database
    Set db = DBEngine.Workspaces(0).OpenDatabase(DBName, dbDriverComplete, False, "; PWD=" & Strpassword)
    Dim FrontDB As DAO.Database, BackDB As DAO.Database, Tbl As TableDef
    Set FrontDB = CurrentDb
    Set BackDB = OpenDatabase(DBName)
    For Each Tbl In BackDB.TableDefs
    If Tbl.Attributes = 0 Then
    DoCmd.TransferDatabase acImport, "Microsoft Access", BackDB.Name, acTable, Tbl.Name, Tbl.Name
    End If
    Next
    BackDB.Close
    FrontDB.Close
    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Structure only arument (Access 2000)

    Click in the word TransferDatabase (in the Visual Basic Editor) and press F1. You'll see that TransferDatabase has an optional argument StructureOnly, which can be True or False:

    DoCmd.TransferDatabase acImport, "Microsoft Access", BackDB.Name, acTable, Tbl.Name, Tbl.Name, True

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •