Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Dec 2003
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy table structure only with RunSQL (Access 2000)

    How do i copy the structure of the table only, and not both the structure and the table?

    With my command
    DoCmd.CopyObject , "students1", acTable, "students"

    i copy the data also, but i want to copy only a blank table, with the structure only

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

    Re: Copy table structure only with RunSQL (Access 2000)

    It's not clear to me why you mention RunSQL in the subject. You can use DoCmd.TransferDatabase to "import" the table into the current database; TransferDatabase has a StructureOnly argument:

    DoCmd.TransferDatabase acImport, "Microsoft Access", CurrentDb.Name, acTable, "Students", "Students1", True

    Please note that the order of the tables is different: in CopyObject, the new name comes first, then the name of the existing table; in TransferDatabase, the source table comes first, then the destination table.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy table structure only with RunSQL (Access 2000)

    thank you for your suggestion it suits me perfectly

Posting Permissions

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