I have a VB6.0 application, using ADODB recordset to find a record for a searched criteria. It only errors out when searching on Alphanumeric data. It works when searching on numeric data. The Error Number is 3001. The Error Message is "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.".
Below is the code, where .Find line would error out.
'ItemQuery = "1340079" 'This item works
'ItemQuery = "0200560" 'This item works
ItemQuery = "NS" 'This item errors out
RecordSet_PriceList.MoveFirst
RecordSet_PriceList.Find RecordSet_PriceList.Fields(0).Name & " = " & ItemQuery
If RecordSet_PriceList.EOF = False Then 'find the item
The ADO recordset is opened to pull from an Excel worksheet as : [rs.Open "Select * from [" & sSheetName & "$]", objAdCon, adOpenKeyset, adLockOptimistic]
Can you please direct me to a good fix? Any input is appreciated.
Below is the code, where .Find line would error out.
'ItemQuery = "1340079" 'This item works
'ItemQuery = "0200560" 'This item works
ItemQuery = "NS" 'This item errors out
RecordSet_PriceList.MoveFirst
RecordSet_PriceList.Find RecordSet_PriceList.Fields(0).Name & " = " & ItemQuery
If RecordSet_PriceList.EOF = False Then 'find the item
'Do my stuff here....
End IfThe ADO recordset is opened to pull from an Excel worksheet as : [rs.Open "Select * from [" & sSheetName & "$]", objAdCon, adOpenKeyset, adLockOptimistic]
Can you please direct me to a good fix? Any input is appreciated.