Using the Find method of the ADODB.Recordset object when the query data contains...

Georgen

Active member
Joined
Jan 22, 2005
Messages
34
Using the Find method of the ADODB.Recordset object when the query data contains this character:

Hi, Ive been having some problems to do this.

Code:
cnn.open sCnnStr  The connections is stablished
sQry = "SELECT * FROM Table" 
rst.open sQry, cnn  Opening the recorset
rst.find "field LIKE " & arg & "*"  do the search

OK I have two (2) questions for this code, what is the wild char I should use: "%" or "*". And second, what happen if the arg parameter contains the char in its definition. For example arg = "VB Programmers Guide to the Windows 32 API". The arg string contains the character so when i do call the Find method it will generate an Error. (I think is error 3011, bah it doesnt matter). So in conclusion, how do I query data when the char appears.??
:p
 
This is VB6 code, and you are posting your question on a VB.Net site. VB.Net does data access very differently (eg. the recordset object no longer exists).
 
oh, Im sorry, I really didnt knew that since I havent work with ADO.NET and stuff... I have indeed heard about the DataSet object or something like that, but I was not aware that the ..Recordset dissapeared... wow.

well. If anybody can help me here... this is not about the code really is just about the problem with using the chararacter in the query, I just want to know how to deal with that. Any help is appreciated.
 
Back
Top