Groups | Blog | Home
all groups > dotnet ado.net > january 2007 >

dotnet ado.net : Copying from one db into another


Paul Clement
1/12/2007 12:20:00 PM
[quoted text, click to view]

¤ Thanks. Still says the same things. ErrorCode=-2147217900 is also the same.
¤

Both Name and Date are reserved words.


Paul
~~~~
John
1/12/2007 12:36:16 PM
Hi

I am trying to copy data from one db into another. Thanks for everyone who
suggested ways to do that. After some more research I have come up with the
below simple looking way. My question in, is it supposed to work this way
and will it work?

LocalConn.Open()

Dim DBCommand As New System.Data.OleDb.OleDbCommand("SELECT id, name, date
INTO (localtable) FROM remotetable IN [Data Source=<ip address>;Initial
Catalog=&quot;RemoteDB&quot;;Persist Security Info=True;User
ID=&quot;username&quot;;Password=password];", LocalConn)

DBCommand.ExecuteNonQuery()

LocalConn.Close()

The remote db is a sql server.

Many Thanks

Regards



John
1/12/2007 1:18:41 PM
Message="The SELECT statement includes a reserved word or an argument name
that is misspelled or missing, or the punctuation is incorrect."

Source="Microsoft JET Database Engine"

I am new to this syntax (when two dbs are involved) so not sure which
parameter is invalid. LocalConn is to a local access db.

Any help would be appreciated.

Thanks

Regards

[quoted text, click to view]

John
1/12/2007 1:32:26 PM
Thanks. Still says the same things. ErrorCode=-2147217900 is also the same.

Regards

[quoted text, click to view]

Stephany Young
1/13/2007 2:11:49 AM
What happened when you tried it?


[quoted text, click to view]

Stephany Young
1/13/2007 2:25:46 AM
Try Select id, name, [date] ...

Date is a reserved word in Jet and to use it as a column name in a SQL
statement you have to decorate it.


[quoted text, click to view]

AddThis Social Bookmark Button