DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   VB6 ACCESS database Connection Query (http://www.daniweb.com/forums/thread97612.html)

pburk Nov 20th, 2007 5:14 am
VB6 ACCESS database Connection Query
 
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

debasisdas Nov 20th, 2007 8:48 am
Re: VB6 ACCESS database Connection Query
 
You should be able to work with that one. There is no such restriction.

pburk Nov 20th, 2007 9:22 am
Re: VB6 ACCESS database Connection Query
 
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

debasisdas Nov 22nd, 2007 8:09 am
Re: VB6 ACCESS database Connection Query
 
If still there is any problem then let me know.

vijaykumar_sajj Nov 13th, 2008 11:09 am
Re: VB6 ACCESS database Connection Query
 
i have problem in visual basic 6 i am using microsoft access i created one query in access query is not opend from visual basic 6

debasisdas Nov 13th, 2008 2:53 pm
Re: VB6 ACCESS database Connection Query
 
please do not hijack others threads .
Please stasrt a new thread of your own for starting a new discussion.


All times are GMT -4. The time now is 5:04 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC