Cannot figure out error in asp code

J

Jack

The following is the error:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'ApplicantIntID ='.
/subgrantapptest/ListSaved.asp, line 53

The following is the code:

<script LANGUAGE="JavaScript">
<!--

if (window != top) top.location.href = location.href;

// -->
</script>
<html>
<head>
<style type="text/css">
p, input, select {color:black; font-size: 10px; HEIGHT:10px; font-family: Verdana, Arial, Helvetica, sans-serif;}
td.head {background-color:#FFFFFF; color:red; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif}
td.body {background-color:#C0C0C0; color:blue; font-size: 10px; height:22; font-family: Verdana, Arial, Helvetica, sans-serif}
</style>
</head>
<table width="604" border="0" cellspacing="0" cellpadding="0" height="1">
<tr>
<td class="head" height="78" colspan="5" width="600"><img src="./images/cc_a.gif" name="cc_a" border="0" alt="Montana Board of Crime Control" width="600" height="100"></td>
</tr>
<tr>
<td class="head" height="4" colspan="2" valign="top"><img src="./images/cc_b.gif" name="cc_b" border="0" alt="Montana Board of Crime Control" width="226" height="37"></td>
<td class="head" width="423" height="4" colspan="3">
<img border="0" src="./images/OnlineAppProcess2.gif"></td>
</table>
<br>
<table width="720" border="0" cellspacing="0" cellpadding="1" height="0">
<tr>
<td class="head" ALIGN="CENTER" BORDER="0">
<img SRC="./images/SavedApp2.gif" BORDER="0" width="252" height="32">
</td>
</tr>
</table>
<!-- #include file="connection.asp" -->
<title><% response.write strTitle & " List Saved" %></title>
<%
dim sql01
dim ApplicantIntID
dim i
dim ProjTitle
dim AppIntID
dim AgencyName
dim AgencyCountyName
dim count

ApplicantIntID = Request.Cookies("ApplicantIntID")
'count = Request.QueryString("count")

strSQL = "SELECT tblApplication.*, RFPTitle, RFPYear, RFPProgramCode FROM tblApplication "
strSQL = strSQL & "INNER JOIN tblRFP ON tblApplication.RFPIntID = tblRFP.RFPIntID"
strSQL = strSQL & " WHERE ApplicantIntID = "
strSQL = strSQL & ApplicantIntID

rstemp.open strSQL, cnn

numrows = rstemp(0)

response.write "<br>" & vbCRLF
response.write "<P>" & vbCRLF
response.write "<table border=0 cellspacing=1 cellpadding=1 height=0>" & vbCRLF
response.write "<tr>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Application Title</b>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Agency</b>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>RFP</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Delete</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Finalize</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Print</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "</tr>" & vbCRLF


do until rstemp.eof
ProjTitle = rstemp("ProjTitle")
AppIntID = rstemp("AppIntID")
AgencyName = rstemp("AgencyName")
AgencyCountyName = rstemp("AgencyCounty")
RFPTitle = rstemp("RFPYear") & " " & rstemp("RFPProgramCode") & "-" & rstemp("RFPTitle")

RFPTitle = rstemp("RFPTitle")
response.write "<tr class='style01'>" & vbCRLF
response.write "<td class='body' align ='center' valign='center'>" & vbCRLF
if rstemp("Locked") = "N" then
response.write "<A HREF='GotoFrame.asp?AppIntID=" & AppIntID & "&ApplicantIntID=" & ApplicantIntID & "'><IMG SRC='./images/SelectButton3.gif' BORDER=0 ALT='Press to Edit " & ProjTitle & "'></A>" & vbCRLF
else
response.write "Finalized"
end if
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write ProjTitle & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write AgencyName & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write RFPTitle & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body' align ='center' valign='bottom'>" & vbCRLF
if rstemp("Locked") = "N" then
response.write "<A HREF='ConfirmDeleteApp.asp?AppIntID=" & AppIntID &"&ApplicantIntID=" & ApplicantIntID & "'><IMG SRC='./images/DeleteButton2.gif' BORDER=0 ALT='Press to Delete'></A>" & vbCRLF
else
response.write "&nbsp&nbsp"
end if
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
if rstemp("Locked") = "N" then
response.write "<A HREF='GotoFinalize.asp?AppIntID=" & AppIntID &"&ApplicantIntID=" & ApplicantIntID & "'><IMG SRC='./images/Finalize.jpg' BORDER=0 ALT='Click to Finalize'></A>" & vbCRLF
else
response.write "&nbsp&nbsp"
end if
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<A HREF='queue_pdf.asp?pdfAppIntID=" & AppIntID & "'><IMG SRC='./images/pdf2.gif' BORDER=0 ALT='Click to PDF Version of Application'></A>" & vbCRLF
' response.write "<A HREF='rpt_display.asp?pdfAppIntID=" & AppIntID & "'><IMG SRC='./images/pdf2.gif' BORDER=0 ALT='Click to PDF Version of Application'></A>" & vbCRLF
' response.write "<A HREF='rpt_display.asp'><IMG SRC='./images/pdf2.gif' BORDER=0 ALT='Click to create PDF Version of Application'></A>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "</tr>" & vbCRLF
rstemp.movenext
loop
response.write "</table>" & vbCRLF
response.write "<br>" & vbCRLF
response.write "</P>" & vbCRLF
%>
<table width="720" border="0" cellspacing="0" cellpadding="1" height="0">
<tr>
<td class="head" ALIGN="CENTER" BORDER="1">
<a HREF="SelectRFP.asp?AppIntID=0&amp;ApplicantIntID=<% response.write ApplicantIntID %>"><img SRC="./images/NewApp4.gif" BORDER="0" ALT="Press to enter a New Application"></a>
</td>
</tr>
</table>
<%
strSQL = "SELECT * FROM tblApplicant WHERE ApplicantIntID = " & ApplicantIntID
rstemp.close
rstemp.open strSQL, cnn
numrows = rstemp(0)
if rstemp("ApplicantSeeUsers") = "Y" then
response.write "<hr>" & vbCRLF
response.write "<A HREF=ListApplicants.asp>List Applicants</A>" & vbCRLF
response.write "&nbsp; " & vbCRLF
response.write "<A HREF=ListFinalized.asp>List Finalized Applications</A>" & vbCRLF
response.write "<BR>" & vbCRLF
end if
rstemp.close
%>
</html>

I appreciate any help for error resolution. Thanks.
 
B

Bob Lehmann

The following is the answer - ApplicationID has no value.

So, instead of making us wade through style definitions and a bunch of HTML,
maybe you could provide information about how the cookie is set?

Bob Lehmann


Jack said:
The following is the error:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'ApplicantIntID ='.
/subgrantapptest/ListSaved.asp, line 53

The following is the code:

<script LANGUAGE="JavaScript">
<!--

if (window != top) top.location.href = location.href;

// -->
</script>
<html>
<head>
<style type="text/css">
p, input, select {color:black; font-size: 10px; HEIGHT:10px; font-family:
Verdana, Arial, Helvetica, sans-serif;}
td.head {background-color:#FFFFFF; color:red; font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif}
td.body {background-color:#C0C0C0; color:blue; font-size: 10px; height:22;
font-family: Verdana, Arial, Helvetica, sans-serif}
</style>
</head>
<table width="604" border="0" cellspacing="0" cellpadding="0" height="1">
<tr>
<td class="head" height="78" colspan="5" width="600"><img
src="./images/cc_a.gif" name="cc_a" border="0" alt="Montana Board of Crime
Control" width="600" height="100"> said:
</tr>
<tr>
<td class="head" height="4" colspan="2" valign="top"><img
src="./images/cc_b.gif" name="cc_b" border="0" alt="Montana Board of Crime
Control" width="226" height="37"> said:
<td class="head" width="423" height="4" colspan="3">
<img border="0" src="./images/OnlineAppProcess2.gif"></td>
</table>
<br>
<table width="720" border="0" cellspacing="0" cellpadding="1" height="0">
<tr>
<td class="head" ALIGN="CENTER" BORDER="0">
<img SRC="./images/SavedApp2.gif" BORDER="0" width="252" height="32">
</td>
</tr>
</table>
<!-- #include file="connection.asp" -->
<title><% response.write strTitle & " List Saved" %></title>
<%
dim sql01
dim ApplicantIntID
dim i
dim ProjTitle
dim AppIntID
dim AgencyName
dim AgencyCountyName
dim count

ApplicantIntID = Request.Cookies("ApplicantIntID")
'count = Request.QueryString("count")

strSQL = "SELECT tblApplication.*, RFPTitle, RFPYear, RFPProgramCode FROM tblApplication "
strSQL = strSQL & "INNER JOIN tblRFP ON tblApplication.RFPIntID = tblRFP.RFPIntID"
strSQL = strSQL & " WHERE ApplicantIntID = "
strSQL = strSQL & ApplicantIntID

rstemp.open strSQL, cnn

numrows = rstemp(0)

response.write "<br>" & vbCRLF
response.write "<P>" & vbCRLF
response.write "<table border=0 cellspacing=1 cellpadding=1 height=0>" & vbCRLF
response.write "<tr>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Application Title</b>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Agency</b>" & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>RFP</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Delete</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Finalize</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<b>Print</b>" & vbCRLF
response.write "</b></td>" & vbCRLF
response.write "</tr>" & vbCRLF


do until rstemp.eof
ProjTitle = rstemp("ProjTitle")
AppIntID = rstemp("AppIntID")
AgencyName = rstemp("AgencyName")
AgencyCountyName = rstemp("AgencyCounty")
RFPTitle = rstemp("RFPYear") & " " & rstemp("RFPProgramCode") & "-" & rstemp("RFPTitle")

RFPTitle = rstemp("RFPTitle")
response.write "<tr class='style01'>" & vbCRLF
response.write "<td class='body' align ='center' valign='center'>" & vbCRLF
if rstemp("Locked") = "N" then
response.write "<A HREF='GotoFrame.asp?AppIntID=" & AppIntID &
"&ApplicantIntID=" & ApplicantIntID & "'><IMG
SRC='./images/SelectButton3.gif' BORDER=0 ALT='Press to Edit " & ProjTitle &
'> said:
else
response.write "Finalized"
end if
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write ProjTitle & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write AgencyName & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write RFPTitle & vbCRLF
response.write "</td>" & vbCRLF
response.write "<td class='body' align ='center' valign='bottom'>" & vbCRLF
if rstemp("Locked") = "N" then
response.write "<A HREF='ConfirmDeleteApp.asp?AppIntID=" & AppIntID
&"&ApplicantIntID=" & ApplicantIntID & "'><IMG
SRC='./images/DeleteButton2.gif' BORDER=0 ALT='Press to Delete'> said:
else
response.write "&nbsp&nbsp"
end if
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
if rstemp("Locked") = "N" then
response.write "<A HREF='GotoFinalize.asp?AppIntID=" & AppIntID
&"&ApplicantIntID=" & ApplicantIntID & "'><IMG SRC='./images/Finalize.jpg'
BORDER=0 ALT='Click to Finalize'> said:
else
response.write "&nbsp&nbsp"
end if
response.write "</td>" & vbCRLF
response.write "<td class='body'>" & vbCRLF
response.write "<A HREF='queue_pdf.asp?pdfAppIntID=" & AppIntID & "'><IMG
SRC='./images/pdf2.gif' BORDER=0 ALT='Click to PDF Version of
Application'> said:
' response.write "<A HREF='rpt_display.asp?pdfAppIntID=" & AppIntID &
"'><IMG SRC='./images/pdf2.gif' BORDER=0 ALT='Click to PDF Version of
Application'> said:
' response.write "<A HREF='rpt_display.asp'><IMG SRC='./images/pdf2.gif'
BORDER=0 ALT='Click to create PDF Version of Application'> said:
response.write "</td>" & vbCRLF
response.write "</tr>" & vbCRLF
rstemp.movenext
loop
response.write "</table>" & vbCRLF
response.write "<br>" & vbCRLF
response.write "</P>" & vbCRLF
%>
<table width="720" border="0" cellspacing="0" cellpadding="1" height="0">
<tr>
<td class="head" ALIGN="CENTER" BORDER="1">
<a HREF="SelectRFP.asp?AppIntID=0&amp;ApplicantIntID=<% response.write
ApplicantIntID %>"><img SRC="./images/NewApp4.gif" BORDER="0" ALT="Press to
 
B

Bã§TãRÐ

The easiest way to depug your SQL statements in asp is .......

response.write strSQL


Yes that is it! - it plugs in all your variables in and you can check
for formatting issues. I use it constantly.

- Bastard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top