Duplicating DB from existing DB (1 Viewer)

imsuneaik

New member
Local time
Today, 07:36
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
Local time
Yesterday, 16:36
Joined
Oct 29, 2018
Messages
10,216
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, 07:36
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
Local time
Yesterday, 16:36
Joined
Oct 29, 2018
Messages
10,216
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, 07:36
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

CID Moderator
Staff member
Local time
Today, 00:36
Joined
Jan 14, 2017
Messages
13,192
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

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom