Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21911

[VB6] - Connect an Ms access 2010 dbase to a VB6 project issue

$
0
0
I used to use this code bellow for accessing an access 2007 dbase but it looks like 2010 is not the same.
I'm also on windows 7 64

I have this error:
Runtime Error 3709
The Connection Cannot be used to perform this kind of operation.
it is either closed or invalid in this context

I think the issue is with this part of the code but i dont know why:
Code:

oRST1.Open Conns, Conn
Can you please help me?

Thanks again

Code:

Dim Conn As ADODB.Connection
Dim Conns As String
Dim oRST1 As ADODB.Recordset
Set oRST1 = New ADODB.Recordset
 
Set Conn = New ADODB.Connection
Conns = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & Form2.txtBaseDelabsolution.Text
Conn.ConnectionString = Conns
'Conn.Open
nom.AddItem ""
oRST1.Open Conns, Conn
Do Until oRST1.EOF
  nom.AddItem oRST1("Nom")
  oRST1.MoveNext
Loop


Viewing all articles
Browse latest Browse all 21911


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>