Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Replace Command "'", "''"
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

NotGiven
Starting Member

Bangladesh
1 Posts

Posted - 30 May 2001 :  21:43:45  Show Profile
Where to put the (Replace "'", "''") command on the attached example by Glenn Cook.

http://www.aspalliance.com/glenncook/searchcode.asp

Thanks for your help.

NotGiven

mafifi
Junior Member

USA
308 Posts

Posted - 31 May 2001 :  20:32:49  Show Profile  Send mafifi an ICQ Message
Use this:

<%

Dim SqlJunk, srchval

srchval = Replace(Request.Form("DaInBox"), "'", "''")

Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
dbGlobalWeb.Open("Employees")

SqlJunk = "SELECT * FROM Employees"

If Request.Form("TypeSearch") = "FirstName" Then
SqlJunk = SqlJunk & " WHERE FirstName LIKE '%" , & srchval & "%'"
End If

If Request.Form("TypeSearch") = "LastName" Then
SqlJunk = SqlJunk & " WHERE LastName LIKE '%", & srchval & "%'"
End If



Hope this helps

Thanks,

Mo
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07