Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I copy an Access database to create my own? 1

Status
Not open for further replies.

Dausa67

Technical User
Oct 1, 2008
96
US
Good Morning,
There is a complete pricing access database that someone else built but no longer works at my company. It would work perfectly for what I need to build. I would like to copy and create my own functional database using most of the pricing database that I mentioned above.

The pricing database is very, very extensive and way above my talent. I have tried to copy some of the tables, queries, forms and reports but it always pointed back to the original tables instead of my tables.

Is it possible for a novice such as myself to copy a whole data base or portions of it, creating a new database with the same integrity? This would include macro's, modules, code and so on.

Clay
 
Create a new Access database and then use

DoCmd.TransferDatabase

to copy whatever you need from the pricing database to the new one. TransferDatabase can transfer tables, queries, modules, reports, macros, Forms, etc. ... virtually every object type that Access supports.

TransferDatabase is fully documented in Access Help.
 
Thank you for the quick response.

If I do the transferdatabase, is there any chance of screwing up the other data base? That is my biggest fear.

Clay
 
This is programming. There's always a chance of screwing something up.

More seriously though, I would do all this by making a copy of your existing Pricing.mdb (or whatever its called) somewhere else and doing my copies from that.

TransferDatabase is a pretty reliable piece of functionality but just getting a couple of arguments in the wrong order could cause some problems.
 
Ok. I will try that.
Thank you for your help.

Clay
 
it always pointed back to the original tables instead of my tables.
If the writer of the original database used DAO code to link it to the data tables then you'll find that your copy will still link back to these tables. Do a search through the code of the program for the name and path of the original database. You may find code like this:
Code:
tdf.Connect = ";DATABASE=C:\myOldDatabase.mdb"
You'll have to find and change these references by hand.

Geoff Franklin
 
And another note about links ...

Access hard-codes the address of a link to an external database so if you copy a linked table to your new database you will still be pointing to the original database. You can use the Linked Table Manager to reset those links and you should also do as alvechurchdata suggests and scan the code to see if the programmer was programatically setting links.
 
Well if you work with a copy then the origional is safe.

Never give up never give in.

There are no short cuts to anything worth doing :)
 
Well if you work with a copy then the origional is safe
I feel you may have missed the point of the last two posts. If the copy contains links to an external database then those links will still point back to the original external database.

You can copy MyCode.mdb and MyData.mdb to a new location but CopyOfMyCode.mdb will still be linked back to the original MyData.mdb and you'll be experimenting on live data.

Geoff Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top