• Copy table structure only with RunSQL (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Copy table structure only with RunSQL (Access 2000)

    Author
    Topic
    #398289

    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

    Viewing 1 reply thread
    Author
    Replies
    • #760364

      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.

      • #760387

        thank you for your suggestion it suits me perfectly

      • #760388

        thank you for your suggestion it suits me perfectly

    • #760365

      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.

    Viewing 1 reply thread
    Reply To: Copy table structure only with RunSQL (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: