|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
asp does not see &
<i><b>Originally posted by : Kirk (kirk@zebraenv.com)</b></i><br />I'm trying to run a query based on an ID number passed in the querystring. The problem is that I concatonate the ID number variable to the SQL query string and this concatonated variable is not seen by the database! Here's the code:<br /><%<br />dim strid<br />strid = Request.querystring("compid")<br />%><br /><html><body><br /><!--#include file = "dataconn.asp"--><br /><%=strid%><br /><%strquery = "SELECT clientcompany.*, clientoffice.* "<br />strquery = strquery&"FROM clientcompany, clientoffice "<br />strquery = strquery&"WHERE clientcompany.id = "&strid<br />strquery = strquery&" AND clientoffice.clientcompany_id = "&strid<br />strquery = strquery&" ORDER BY state, city"<br />set objRS = objconn.execute (strquery)%><br /><br />The following is the error I'm receiving:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'clientcompany.id = AND clientoffice.clientcompany_id ='. <br /><br />/zoffice/zebra01/kirk's files/company.asp, line 15 <br /><br />The weird thing is that I've got the exact same ASP files running on a server at home, and the code works fine!!!!!!<br />Please help!<br /><br /><br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : steve</b></i><br />can you write out the querystring value. <br /><br />like <% response.write Request.querystring("compid") to even see if the value is getting passed into this?<br /><br />steve<br /><br /><br />------------<br />Kirk at 2/15/2000 1:51:36 PM<br /><br />I'm trying to run a query based on an ID number passed in the querystring. The problem is that I concatonate the ID number variable to the SQL query string and this concatonated variable is not seen by the database! Here's the code:<br /><%<br />dim strid<br />strid = Request.querystring("compid")<br />%><br /><html><body><br /><!--#include file = "dataconn.asp"--><br /><%=strid%><br /><%strquery = "SELECT clientcompany.*, clientoffice.* "<br />strquery = strquery&"FROM clientcompany, clientoffice "<br />strquery = strquery&"WHERE clientcompany.id = "&strid<br />strquery = strquery&" AND clientoffice.clientcompany_id = "&strid<br />strquery = strquery&" ORDER BY state, city"<br />set objRS = objconn.execute (strquery)%><br /><br />The following is the error I'm receiving:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'clientcompany.id = AND clientoffice.clientcompany_id ='. <br /><br />/zoffice/zebra01/kirk's files/company.asp, line 15 <br /><br />The weird thing is that I've got the exact same ASP files running on a server at home, and the code works fine!!!!!!<br />Please help!<br /><br /><br />
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : Kirk (kirk@zebraenv.com)</b></i><br />Yes. I did that and the querystring is being passed perfectly.<br /><br /><br />------------<br />steve at 2/15/2000 4:45:46 PM<br /><br />can you write out the querystring value. <br /><br />like <% response.write Request.querystring("compid") to even see if the value is getting passed into this?<br /><br />steve<br /><br /><br />------------<br />Kirk at 2/15/2000 1:51:36 PM<br /><br />I'm trying to run a query based on an ID number passed in the querystring. The problem is that I concatonate the ID number variable to the SQL query string and this concatonated variable is not seen by the database! Here's the code:<br /><%<br />dim strid<br />strid = Request.querystring("compid")<br />%><br /><html><body><br /><!--#include file = "dataconn.asp"--><br /><%=strid%><br /><%strquery = "SELECT clientcompany.*, clientoffice.* "<br />strquery = strquery&"FROM clientcompany, clientoffice "<br />strquery = strquery&"WHERE clientcompany.id = "&strid<br />strquery = strquery&" AND clientoffice.clientcompany_id = "&strid<br />strquery = strquery&" ORDER BY state, city"<br />set objRS = objconn.execute (strquery)%><br /><br />The following is the error I'm receiving:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'clientcompany.id = AND clientoffice.clientcompany_id ='. <br /><br />/zoffice/zebra01/kirk's files/company.asp, line 15 <br /><br />The weird thing is that I've got the exact same ASP files running on a server at home, and the code works fine!!!!!!<br />Please help!<br /><br /><br />
|
|
#4
|
|||
|
|||
|
<i><b>Originally posted by : Chris Snider (csnider@worldnet.att.net)</b></i><br />It appears as though you need spacing around teh concatenation operator (the &)<br />Rewrite each line as<br />strquery = strquery & "WHERE clientcompany.id = " & strid<br /><br />This should clear up the problem<br /><br /><br /><br />------------<br />Kirk at 2/16/2000 9:16:08 AM<br /><br />Yes. I did that and the querystring is being passed perfectly.<br /><br /><br />------------<br />steve at 2/15/2000 4:45:46 PM<br /><br />can you write out the querystring value. <br /><br />like <% response.write Request.querystring("compid") to even see if the value is getting passed into this?<br /><br />steve<br /><br /><br />------------<br />Kirk at 2/15/2000 1:51:36 PM<br /><br />I'm trying to run a query based on an ID number passed in the querystring. The problem is that I concatonate the ID number variable to the SQL query string and this concatonated variable is not seen by the database! Here's the code:<br /><%<br />dim strid<br />strid = Request.querystring("compid")<br />%><br /><html><body><br /><!--#include file = "dataconn.asp"--><br /><%=strid%><br /><%strquery = "SELECT clientcompany.*, clientoffice.* "<br />strquery = strquery&"FROM clientcompany, clientoffice "<br />strquery = strquery&"WHERE clientcompany.id = "&strid<br />strquery = strquery&" AND clientoffice.clientcompany_id = "&strid<br />strquery = strquery&" ORDER BY state, city"<br />set objRS = objconn.execute (strquery)%><br /><br />The following is the error I'm receiving:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'clientcompany.id = AND clientoffice.clientcompany_id ='. <br /><br />/zoffice/zebra01/kirk's files/company.asp, line 15 <br /><br />The weird thing is that I've got the exact same ASP files running on a server at home, and the code works fine!!!!!!<br />Please help!<br /><br /><br />
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > asp does not see & |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|