Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

 

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 Programmer's 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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...