Hi all,
I am trying to use the index and seek instructions to find a record by a
index. at the moment I am not able to get this working. I am using eMbedded
Visual Basic 3.0 and the code I am trying is this:
Dim rs As ADOCE.Recordset
Dim rsArt As ADOCE.Recordset
Dim objConn As ADOCE.Connection
Dim cCon As String
Dim cConN As String
Dim nReg As Long
'Dim Id(1) As String
Set rs = CreateObject("ADOCE.Recordset.3.0")
Me.Buscar.Caption = "Busca.."
'Abre la conexion
Set objConn = CreateObject("ADOCE.Connection.3.0")
objConn.Open "Provider=CEDB;" & _
"data source = \My Documents\Articulos.cdb"
cCon = "ARTICULOS"
rs.Open cCon, objConn, adOpenDynamic, adLockOptimistic, adCmdTableDirect
rs.Index = "PrimaryKey"
Id(0) = Trim(refart.Text)
rs.Seek Id(0), adSeekFirstEQ
If Not rs.EOF Then 'si encuentra el articulo
'MsgBox ("entra")
If IsNull(rs.fields(1).Value) Then
codbar.Text = ""
Else
codbar.Text = rs.fields(1).Value
End If
If IsNull(rs.fields(2).Value) Then
descrip.Text = ""
Else
descrip.Text = rs.fields(2).Value
End If
rs.close
Set rs = Nothing
Please help me, Thanks in advance.
Javier Martinez