Copy of current database

D

Dorian Chalom

Is it possible to create a copy of your current database through code?

I have a data base and the only difference between the district database and
the schools version of the database is the tables are not copied over. So i
had this thought why don't I create a routine that woulkd copy over
everything needed from the current database to another database excluding
the datatables for the schools to use?

Is it possible? And How would i do it?
 
M

Marshall Barton

Dorian said:
Is it possible to create a copy of your current database through code?

I have a data base and the only difference between the district database and
the schools version of the database is the tables are not copied over. So i
had this thought why don't I create a routine that woulkd copy over
everything needed from the current database to another database excluding
the datatables for the schools to use?

You should never copy an open file, especially a database
file.

Use a batch script or another program to copy the database.
 
K

Katrina

I have the same sort of set up...

I have a module with the following code



Function A()
Dim objReport As Object ' Generic object
variable

For Each objReport In CurrentProject.AllReports
DoCmd.TransferDatabase acExport, "Microsoft
Access", "\\Esco_fs6\Marketing\DataBases\Sales
Database.mdb", acReport, objReport.NAME, objReport.NAME
Next objReport

Dim objForm As Object ' Generic object
variable

For Each objForm In CurrentProject.AllForms
DoCmd.TransferDatabase acExport, "Microsoft
Access", "\\Esco_fs6\Marketing\DataBases\Sales
Database.mdb", acForm, objForm.NAME, objForm.NAME
Next objForm

Dim objMacro As Object ' Generic object
variable

For Each objMacro In CurrentProject.AllMacros
DoCmd.TransferDatabase acExport, "Microsoft
Access", "\\Esco_fs6\Marketing\DataBases\Sales
Database.mdb", acMacro, objMacro.NAME, objMacro.NAME
Next objMacro
End Function



Then I have a macro set up with a line that says RunCode
and then the code is "A"
 
D

Dorian Chalom

But I have modules too to copy over. So I guess I could create this code in
a seperate module and in the module part of the transfer over filter out
this module with an IF...ENDIF so it would not copy this opwen module.

Yes????
 
D

Dorian Chalom

OK but the program is not a centralized program each school has thier own
copy of it adn I want to get away from having to create the users version
every year for them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top