I'm trying to write a very simple data migration program.
I have a SQL2000 Database on one machine and an Access Database on another. I'm trying to move the SQL data to Access.
What I've done is:
Set Conn1 = CreateObject("ADODB.Connection"
Conn1.Open "DSN", "User", "Pwd"
Set Conn2 = CreateObject("ADODB.Connection"
Conn2.Open "DSN", "User", "Pwd"
Set Rst1 = Conn1.Execute(" Select * from Table1"
Do While Not Rst1.EOF
Conn2.Execute (" Insert into Telnumbers(Field1,Field2,Field3) Values(Rst1!Value1, Rst1!Value2, Rst1!Value3)"
Rst1.MoveNext
Loop
Which, of course does not insert the values, because SQL doesn't recognize the variables. Is there a simple way to get this done?
Thanks.
I have a SQL2000 Database on one machine and an Access Database on another. I'm trying to move the SQL data to Access.
What I've done is:
Set Conn1 = CreateObject("ADODB.Connection"
Conn1.Open "DSN", "User", "Pwd"
Set Conn2 = CreateObject("ADODB.Connection"
Conn2.Open "DSN", "User", "Pwd"
Set Rst1 = Conn1.Execute(" Select * from Table1"
Do While Not Rst1.EOF
Conn2.Execute (" Insert into Telnumbers(Field1,Field2,Field3) Values(Rst1!Value1, Rst1!Value2, Rst1!Value3)"
Rst1.MoveNext
Loop
Which, of course does not insert the values, because SQL doesn't recognize the variables. Is there a simple way to get this done?
Thanks.