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

Copy Objects between remote databases

Status
Not open for further replies.

AlPhilps

Programmer
Nov 14, 2002
14
GB
I want to copy objects from Remote Database1 to Remote Database2, whilst the code is resting in Database3.

I realise that the CopyObject function only permits me to copy from a Source database to a remote specified database, not from remote to remote.

Any ideas? Or am i Stuffed?

Ta

Al

 
One alternative is to copy from 1 to 3 and then from 3 to 2.

David David Pimental
(US, Oh)
dpimental@checkfree.com
 
*One alternative is to copy from 1 to 3 and then from 3 to 2.*

Hmmm. If I go into #1 tho, I might as well copy straight to #2?
 
Try the following:
[tt]
Dim ObjFrom As New Access.Application, ObjTo As New Access.Application

ObjFrom.OpenCurrentDatabase ("C:\From.mdb")
ObjTo_OpenCurrentDatabase ("C:\To.mdb")
ObjFrom.DoCmd.CopyObject "C:\To.mdb", "tblA", acTable, "tblA"
ObjTo.CurrentDb.Close
ObjTo.CloseCurrentDatabase
Set ObjTo = Nothing
ObjFrom.CurrentDb.Close
ObjFrom.CloseCurrentDatabase
ObjFrom.Quit acQuitSaveNone
Set ObjFrom = Nothing
[/tt]
hth,
GGleason
 
Ah, mebbe I should have pointed out we're still using Access v2 here?
That rules out OpenCurrentDatabase I think?

Ta

Al

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top