Link to home
Start Free TrialLog in
Avatar of jtjcomp
jtjcomp

asked on

VB to connect to 2 seperate Databases

I'm using vb 6 and trying to connect to two separate access 2000 databases.  My question is this:  When I make the connection and try to copy data from one table (in DB1) to another table(in DB2) I get an error.
The command I use for this copy is
table1.addnew
table1.fields("Field1") = table2.fields(Field1")
table1.update

This does not work.  The way that I can make it work is

table1.addnew
x = table2.fields("Field1)
table1.fields("Field1") = x
table1.update


My question is: Does visual basic not allow access to two separate databases on the same line of code?

Thanks in advance
Avatar of jtjcomp
jtjcomp

ASKER

Edited text of question.
ASKER CERTIFIED SOLUTION
Avatar of mmips
mmips

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try this:
"bd1.table1.fields("Field1") = bd2.table2.fields("Field1").value