DoCmd " "," ",copy everything," "

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All

The answer to this is probably no – but I thought I would ask

Can I use DoCmd.CopyObject to copy an entire database. Something like

DoCmd.CopyObject "WaynesNewDB", "SomeNewName", ac????, "MyOldDB"

If not (which is almost certain) does anyone have any ideas on how to copy a
DB to a new location.


Basically I want to copy the backend from the server to a load of laptops
that are used as stand alone terminals (not FE) - each has a copy of access
2003. The field staff simply complete some forms, connect to the internet
and click a button to send the info back to IT (me). Every now and then I
need to upgrade the laptops and this is very time consuming – so I’m looking
for a method of simply copying a new copy of the BE on to the laptops. - if
pos with the same name but this is not too important as I can delete the old
copy before (hopefully) bringing in the new copy.

Been working on this for a week - and getting nowhere so would really
appreciate any hints
 
I think you could use:

app.DoCmd.CopyObject in a widows script file you run from your desktop which
could be set up to copyy your DB to every laptop on your network as long as
they were logged on. I use a couple script files like this to overwrite new
tables on a monthly basis.
 
There is this but I can't figure out how to get it to work.

DoCmd.RunCommand acCmdCopyDatabaseFile
 
Hi Jeff

At the moment I am looking into calling all the machines in on a reg basis
and simply using a memory stick and explorer.

I have banned all field reps from "ever" conecting to the server as they
sometimes do some "very" strange research (being polit there) on the
internet. ??? Looking at some of the registry entries when staff leave is an
eye opener to be sure??

So - I am working along the lines of exporting a new copy of the DB from a
memory stick using copyobject - but hit a brick wall at the moment. There
"must be a method using vba of intserting a stick and copying a copy of a db
wholey on to a laptop C:
 
VBA has a FileCopy statement that will let you copy a file (assuming, of
course, that it's not in use).

Otherwise, you can write a query that will get you the names of the tables
in a specific database using:

SELECT [Name]
FROM [;Database=F:\Folder\File.MDB].MSysObjects
WHERE [Type] = 1
AND [Name] NOT LIKE "MSys*"
ORDER BY [Name];

Use that to populate a recordset, loop through the recordset, using
TransferDatabase (rather than CopyObject)
 
Hi Jerry

I am working on a FileSystemObject public function as this can copy an open
DB to "somewhere". This way I "should" be able to run the copy from an open
copy of the DB on a stick onto the C; of a laptop. It really should be
simpler than this to backup a db to another drive.

Dim db As Database
Set db = CurrentDb()
etc
etc
etc

May have to revert to windows explorer (LoL) drag and drop - but I am too
dogged to let this beat me. I "will" get a simple one button form to do this
 
Hi Douglas

Will that not delete the relationships.


--
Wayne
Manchester, England.



Douglas J. Steele said:
VBA has a FileCopy statement that will let you copy a file (assuming, of
course, that it's not in use).

Otherwise, you can write a query that will get you the names of the tables
in a specific database using:

SELECT [Name]
FROM [;Database=F:\Folder\File.MDB].MSysObjects
WHERE [Type] = 1
AND [Name] NOT LIKE "MSys*"
ORDER BY [Name];

Use that to populate a recordset, loop through the recordset, using
TransferDatabase (rather than CopyObject)
 
Thanks Jeff, Jerry and Douglas.

Ha Ha Ha I don't know how many modules access can holds but I think I may
have filled this copy with rubbish.

Oh well - going skiing for 2 weeks to Italy tomorrow. I am sure the problem
will still be here when I get back.

On the assumption that I still can't get it to work I will ask again. If
you do think of anything I really would be greateful if you could reply to
this post and I will check as soon as possible.

Many thanks for your time and expertise.
 

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

Similar Threads


Back
Top