I want to copy data from one database to another database. The databases are access and I want to use ADO in VB to do this. Any suggestions??
/Smirre
Printable View
I want to copy data from one database to another database. The databases are access and I want to use ADO in VB to do this. Any suggestions??
/Smirre
You can do it in two ways:
1- use two ADO connections, loop through the records of the tables of the first database, and add new records in the other.
2- Create linked tables in the destination database that reference the source database and use an Insert query to copy the records.
You mean that I should use the addnew method of the recordset object??
Can this be done with out using the addnew method of the recordset object.
/Smirre
You can either use the AddNew Method, or you can use the Execute method directly from the connection.
mConn.Execute "Insert Into table1 (field1, field2, field3) values (value1, value2, value3)"
Ok, never thought of that.
What are pro and cons with your two suggested ways of doing this??
What way do you think would be the fastest and the "safest". This operation is going to run every 20 minutes.
/Smirre
It's of course faster to use the Execute method.
I meant the first two options you suggested. connections vs linked....
I know that the execute will be faster than the and new method of the recordset.
/Smirre