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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a Database Structure Only 1

Status
Not open for further replies.

stotzc001

Technical User
Mar 27, 2003
30
0
0
US
I have a database that needs to be closed out on a fiscal year basis (FY2004.mdb). What I want to do is create a function that will copy my database (structure only) to a new file called FY2005.mdb

Once that is complete I can fill the new database with the information that is carried over from the previous fiscal year.

Any Ideas??
 
I guess I needed to be a little more clear on what I wanted to do. I need to copy all the tables in my database (structure only), queries, reports, and macro's.

Any ideas?
 
I won't be around to do the carryover so I want it to be as transparent as possible to the end user.
 
Hi

Yes.. well I meant in Code

Copy MyDb2004.mdb MyDb2005.mdb
Set Db = ws.Opendatabase("MyDb2005")
For each tdf in Db.TAbledefs
if left(tdf.name,4) <> "Msys" Then
strSQL = "DELETE * FROM " & tdf.name & ";"
db.execute strSQL
End If
Next tdf

I leave the Dim statements for you, you need a refrence to DAO library


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thats what I was looking for. Thanks and enjoy the star.

Chuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top