First of all in your HTML use Maxlength to limit number of charcters users can type in the searchstring,
<input type="text" name="searchstring" maxlength="30"/>
use VBScript replace function to escape apostrophe (')
STR = Replace(Trim(Request.Form("searchstring")),"'","'' )
I would recommend you use stored procedure along with ASP command object..
that way you do not have to worry about escaping or sql injection attack..
|