Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: SQL Wildcards and ASP


Message #1 by "James Allen" <aspjim@l...> on Tue, 22 Aug 2000 22:29:55
I'm creating a page where users can search certain fields and want to make 

use of the SQL Wildcard '%'. When I type in 'text%', records are returned 

beginning with 'text'. When I type '%text%', records containing 'text' are 

returned. So far so good. But when I type '%text', attempting to find 

records ending in 'text' I get the error message:

 ADODB.Recordset error '800a0bb9' 

 Arguments are of the wrong type, are out of acceptable range, or are in

 conflict with one another.



The relevant bits of code doing this are:



If Len(Request.Form("txtContactName")) <> 0 Then

    strContactName = CStr(Request.Form("txtContactName"))

    strCriteria = strCriteria & "ContactName LIKE '" & strContactName & 

"'"

End If



objRSCompanies.Filter = strCriteria 



This last line is where the error is produced.

Any ideas?



Thanks, Jim Allen.


  Return to Index