Hi All,
I need to run a Select statement using a variable. The code looks like the following:
<%
varCity = Request.QueryString ("varCity"
varBusiness = Request.QueryString ("varBusiness"
Dim oRSb
set oRSb=Server.CreateObject("ADODB.Recordset"
sqltext = "SELECT Company, BusinessStreet, BusinessCity, BusinessPhone, WebPage "
sqltext = sqltext & " FROM Contacts WHERE BusinessCity = '" & varCity & "';"
sqltext = sqltext & " AND '" & varBusiness & "' = true "
oRSb.Open sqltext, "DSN=EHome"
oRSb.MoveFirst
%>
varBusiness is a variable refering to a column in my table. I need it to check to see if the column has a "true" value before printing it in the table.
With this code I am getting an error saying Characters found after end of SQL statement
Can anyone show me the correct code to get this to work?
Thanks,
mot98
![[pc] [pc] [pc]](/data/assets/smilies/pc.gif)
"Every day I learn something new, and forget 10 things I learned long ago!"
I need to run a Select statement using a variable. The code looks like the following:
<%
varCity = Request.QueryString ("varCity"
varBusiness = Request.QueryString ("varBusiness"
Dim oRSb
set oRSb=Server.CreateObject("ADODB.Recordset"
sqltext = "SELECT Company, BusinessStreet, BusinessCity, BusinessPhone, WebPage "
sqltext = sqltext & " FROM Contacts WHERE BusinessCity = '" & varCity & "';"
sqltext = sqltext & " AND '" & varBusiness & "' = true "
oRSb.Open sqltext, "DSN=EHome"
oRSb.MoveFirst
%>
varBusiness is a variable refering to a column in my table. I need it to check to see if the column has a "true" value before printing it in the table.
With this code I am getting an error saying Characters found after end of SQL statement
Can anyone show me the correct code to get this to work?
Thanks,
mot98
![[pc] [pc] [pc]](/data/assets/smilies/pc.gif)
"Every day I learn something new, and forget 10 things I learned long ago!"