Rexolio
Technical User
- Aug 29, 2001
- 230
I have an ASP that is supposed to allow the user to click on a Client's Business name, which will return all location information from any and all records for that business name and business address.
The problem I'm having is that the script wouldn't return Business names with single quotation marks (i.e. Sam's Club). I thought I understood the reason, so I went from this...
SQL="SELECT DISTINCT Location FROM tblDirectory WHERE CompanyName = '" & CompanyName & "' AND Address = '" & Address & "' ORDER BY Location"
to this...
CompanyName = Replace(CompanyName,"'",""
LoSQL="SELECT DISTINCT Location FROM tblDirectory WHERE CompanyName = '" & CompanyName & "' AND Address = '" & Address & "' ORDER BY Location"
Now, what the new, second script does is only pull records for CompanyNames that HAVE single quotation marks. If the CompanyName doesn't have single quote marks, it doesn't return anything.
I've tried the following also without a change
CompanyName = Replace(CompanyName,"'","''"
PLEASE HELP!
The problem I'm having is that the script wouldn't return Business names with single quotation marks (i.e. Sam's Club). I thought I understood the reason, so I went from this...
SQL="SELECT DISTINCT Location FROM tblDirectory WHERE CompanyName = '" & CompanyName & "' AND Address = '" & Address & "' ORDER BY Location"
to this...
CompanyName = Replace(CompanyName,"'",""
LoSQL="SELECT DISTINCT Location FROM tblDirectory WHERE CompanyName = '" & CompanyName & "' AND Address = '" & Address & "' ORDER BY Location"
Now, what the new, second script does is only pull records for CompanyNames that HAVE single quotation marks. If the CompanyName doesn't have single quote marks, it doesn't return anything.
I've tried the following also without a change
CompanyName = Replace(CompanyName,"'","''"
PLEASE HELP!