Click here to Skip to main content
15,886,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dim cn
Dim strConn
Dim rs
Dim strQuery
Dim f, strFields
Set cn = CreateObject("ADODB.Connection")


strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Users\Shadi\Desktop;" & _
"Extended Properties=dBase IV;"
cn.Open strConn
Set rs = CreateObject("ADODB.Recordset")

strAnswer = InputBox("Please enter the bar code:", _
"Search")


strQuery = "SELECT * FROM fursan.dbf WHERE BAR_CODE = '" + strAnswer + "'"
rs.CursorLocation = 3
rs.Open strQuery, cn, 3, 3

For Each f In rs.Fields
strFields = strFields & f.Name & vbCrLf
Next
'MsgBox strFields
With rs
MsgBox "Full Name: " & .Fields("FULL_NAME").Value
MsgBox "Card_ID: " & .Fields("CARD_ID").Value
MsgBox "PRN_STATE: " & .Fields("PRN_STATE").Value
MsgBox "BARCODE: " & .Fields("BAR_CODE").Value


'.Fields("PRN_STATE").Value = " "
'.Update
End With
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Posted
Comments
Shady H. 11-Nov-15 3:23am    
Any advises ???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900