|
-
Jan 23rd, 2002, 04:00 AM
#1
Thread Starter
Hyperactive Member
Copy data from one database to another???
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
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Jan 23rd, 2002, 04:20 AM
#2
Hyperactive Member
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.
-
Jan 23rd, 2002, 04:26 AM
#3
Thread Starter
Hyperactive Member
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
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Jan 23rd, 2002, 04:39 AM
#4
Hyperactive Member
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)"
-
Jan 23rd, 2002, 04:43 AM
#5
Thread Starter
Hyperactive Member
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
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Jan 23rd, 2002, 04:48 AM
#6
Hyperactive Member
It's of course faster to use the Execute method.
-
Jan 23rd, 2002, 04:51 AM
#7
Thread Starter
Hyperactive Member
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
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|