We currently have a website that can search an Access database.
The database is our customer list.
The problem I am having is if there is a "&" in the customer name, it does not pull up a record because the sql statement thinks I am trying to find 2 seperate strings instead of one.
In the example below Request.QueryString("CustName")
could = Gary & Co. It tries to find the record where CustName = Gary and also Co not "Gary & Co"
<%
Dim CustomerData__MMColParam
CustomerData__MMColParam = "1"
if (Request.QueryString("CustName") <> "") then CustomerData__MMColParam = Request.QueryString("CustName")
%>
<%
set CustomerData = Server.CreateObject("ADODB.Recordset")
CustomerData.ActiveConnection = MM_QBCustomerData_STRING
CustomerData.Source = "SELECT * FROM QBCustData WHERE CustName = '" + Replace(CustomerData__MMColParam, "'", "''") + "'"
CustomerData.CursorType = 0
CustomerData.CursorLocation = 2
CustomerData.LockType = 3
CustomerData.Open()
CustomerData_numRows = 0
%>
Anyone know a way around this?
Thanks,
Nate