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

SQL DMO - Transfer Object

Status
Not open for further replies.

tb

Programmer
May 27, 2003
328
Hi all,

I have the following code to transfer a table from one database to another on the same server ...

Private myServer As SQLDMO.SQLServer
Private myFromDatabase As SQLDMO.Database
Private myTransfer As SQLDMO.Transfer

============================================

Set myServer = New SQLDMO.SQLServer
Set myFromDatabase = New SQLDMO.Database
Set myTransfer = New SQLDMO.Transfer

With myServer
.Connect "IP Address", "UserName", "Password"
Set myFromDatabase = myServer.Databases("Source_DB")

myTransfer.AddObjectByName "myTable_To_Transfer", SQLDMOObj_UserTable
myTransfer.DestDatabase = "Destination_DB"
myTransfer.CopyAllTables = False

myFromDatabase.Transfer myTransfer

End With

and it keeps giving me the following errors ...
1. SQL server does not exist or access denied
2. Connection open [Connect]

Notes on errors:
1. using sa
2. ??

Any ideas or tips will be greatly appreciated.
[flowerface]

I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
 
Ok - Problem solved ..

FYI - Needed to specify the following
.DestServer
.DestLogin
.DestPassword

[flowerface]

I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top