| | |
VB6 ACCESS database Connection Query
![]() |
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
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
pburk@fnb.co.za
‘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
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
pburk@fnb.co.za
‘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
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Solved Threads: 0
Many thanks for your time. I will be giving it another try tonight ( It's now 15h30 my time) .
I agree there should be no such restriction but I seemed to be experiencing it last night.
thanks again
Peter B.
pburk@fnb.co.za
I agree there should be no such restriction but I seemed to be experiencing it last night.
thanks again
Peter B.
pburk@fnb.co.za
![]() |
Similar Threads
- Running a VB application with MS Access database (Visual Basic 4 / 5 / 6)
- database connection(select ,insert query) within javascript function (JSP)
- Help: Need to access database when session times out (ASP.NET)
- simultaneous MS Access Database access problem using VB6 program. (Visual Basic 4 / 5 / 6)
- Connecting password protected MS Access database from C# (C#)
- Update user-level security (MS Access) in VB6 (Visual Basic 4 / 5 / 6)
- Database Connection in Visual Studio 2005 (ASP.NET)
- access database search and display (Visual Basic 4 / 5 / 6)
- Pls help me regarding to access database in vb6 (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: CreateDirectory
- Next Thread: Other Language DLL
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






