VB6Query20071120.doc
Hi
VB6
I am trying to have 2 ACCESS databases open at the same time in order to populate the 2nd one with data from the first one. The problem is that it appears that I can only have one connection to a database at a time. Is this true and how do I get around this ? So the code below does not work when the program pointer gets to the destination connection unless I’ve closed the Source connection. If I do that then I can no longer talk to the Source recordset ! If I leave the source connection open while trying to talk to the destination connection I’m actually manipulating the Source connection.
Many thanks
Peter Burkimsher
‘PathD = path and Source database name
‘ PathE = path and Destination database name
Dim SourceAccConnection As New ADODB.Connection
Dim rsInputRead As New ADODB.Recordset
Dim DestAccConnection As New ADODB.Connection
Dim rsDestRead As New ADODB.Recordset
SourceAccConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & PathD & ";"
rsInputRead.Open "SELECT * FROM Runtime " _
& "ORDER BY Date , Priority, Description ;", SourceAccConnection, adOpenKeyset, adLockOptimistic
DestAccConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & PathE & ";"
rsDestRead.Open "SELECT * FROM Runtime " _
& "ORDER BY Date , Priority, Description ;", SourceAccConnection, adOpenKeyset, adLockOptimistic