PC Review


Reply
Thread Tools Rate Thread

Copy of current database

 
 
Dorian Chalom
Guest
Posts: n/a
 
      30th Jul 2003
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?


 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      30th Jul 2003
Dorian Chalom wrote:

>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.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
Katrina
Guest
Posts: n/a
 
      30th Jul 2003
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"



>-----Original Message-----
>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?
>
>
>.
>

 
Reply With Quote
 
Dorian Chalom
Guest
Posts: n/a
 
      30th Jul 2003
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????

"Katrina" <(E-Mail Removed)> wrote in message
news:014901c356ce$7d024ba0$(E-Mail Removed)...
> 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"
>
>
>
> >-----Original Message-----
> >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?
> >
> >
> >.
> >



 
Reply With Quote
 
Dorian Chalom
Guest
Posts: n/a
 
      31st Jul 2003
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.


"Marshall Barton" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> Dorian Chalom wrote:
>
> >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????

>
> Maybe, if you make certain that all copied objects are
> closed first. The CopyObject method is probably more
> appropriate than TransferDatabase
>
> It sounds as if you're trying to write code to update the
> user's copy of your application to include your new
> forms/reports/code. If so, this is not a good way to go
> about it. It is **MUCH** better to copy a complete new
> front end MDB file to each user's machine. See Tony Toews'
> thoughts on this question:
>
> http://www.granite.ab.ca/access/splitapp.htm
> and
> http://www.granite.ab.ca/access/autofe.htm
>
> --
> Marsh
> MVP [MS Access]



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link form another database table into current database Anna Microsoft Access Forms 2 16th Aug 2006 08:57 PM
Making a copy of the current database using code Janelle.Dunlap@ge.com Microsoft Access 3 31st May 2006 12:19 AM
Make Copy Of Current Database File =?Utf-8?B?TWFydGlu?= Microsoft Access 2 20th Jan 2006 04:26 AM
Copy over current Database Katrina Microsoft Access VBA Modules 2 19th Apr 2004 02:42 PM
Opening a copy of the current database through VBA code Adam Microsoft Access 13 15th Sep 2003 12:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:03 AM.