Duplicating DB from existing DB (1 Viewer)

imsuneaik

New member
Local time
Today, 22:59
Joined
Sep 5, 2019
Messages
8
Hi everyone,
I would like to create a new fresh database (same objects, without data) from the original one. While ctrl c + ctrl v works for the objects, I realised that relationships can't be copied in this manner. Using the inbuilt import function causes all datas to be copied in as well, together with the relationships.

May I know how do I go about this issue? Thanks in advance!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:59
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to AWF! There are several ways you can approach this. For example, you could simply create a copy of the DB and give it a new name. Then, simply delete all the data manually, using code, or a macro. You could also give the TransferDatabase method a try.
 

imsuneaik

New member
Local time
Today, 22:59
Joined
Sep 5, 2019
Messages
8
Hi. Welcome to AWF! There are several ways you can approach this. For example, you could simply create a copy of the DB and give it a new name. Then, simply delete all the data manually, using code, or a macro. You could also give the TransferDatabase method a try.

Thank you for the reply. I am trying to first method, of deleting it manually. However, some of my tables are autonumbered, as a result the records will not start from 1 right?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:59
Joined
Oct 29, 2018
Messages
21,358
Thank you for the reply. I am trying to first method, of deleting it manually. However, some of my tables are autonumbered, as a result the records will not start from 1 right?
Don't worry about it. After you have deleted all the data, do a Compact & Repair as a final clean up process, and it will also reseed all Autonumber fields to one, provided the table is empty.
 

imsuneaik

New member
Local time
Today, 22:59
Joined
Sep 5, 2019
Messages
8
Don't worry about it. After you have deleted all the data, do a Compact & Repair as a final clean up process, and it will also reseed all Autonumber fields to one, provided the table is empty.

Thank you. It works!
 

isladogs

MVP / VIP
Local time
Today, 14:59
Joined
Jan 14, 2017
Messages
18,186
When you import tables from an external database, you can do so with the data or just import empty tables by selecting Definition Only in Options

 

Attachments

  • ImportNoData.PNG
    ImportNoData.PNG
    15.3 KB · Views: 162

Users who are viewing this thread

Top Bottom