Tengo el siguiente problema cuando ejecuto mi programa en visual Basic 6.0 a una base de datos de Access 2000 por medio de Ado me aparece el siguiente error:
“error 3709 the connection cannot be used to perform this operations. It is either closed on invalid in this context”
Option Explicit
Private cnn As ADODB.Connection
Private WithEvents rst As ADODB.Recordset
Private Sub Buscar2_Click()
Const sPathBase As String = "C:\Inventario\Inventario1.mdb"
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sPathBase & ";"
cnn.Open
nSQL = "select * from tb_Inventario where num_joya =" & Left$(cmbJoyeria.Text, 3)
rst.Open nSQL
'Set rsInventario = BaseDatos.OpenRecordset(nSQL)
Do Until rst.EOF
grJoyas.AddItem ""
grJoyas.TextMatrix(Fila_Registro, 0) = rst!cod_articulo
rst.MoveNext
Loop
End Sub
Muchas gracias por leer este foro y al que me puedas responder muchisimas gracias