Georgen Posted February 9, 2005 Posted February 9, 2005 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 Quote
Optikal Posted February 10, 2005 Posted February 10, 2005 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). Quote
Georgen Posted February 11, 2005 Author Posted February 11, 2005 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.