Re: Cannot figure out error in asp code

From: Bã§TãRÐ (nobody_at_msn.com)
Date: 07/27/04


Date: Tue, 27 Jul 2004 05:29:36 GMT

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.

- ***

On Sat, 24 Jul 2004 21:46:05 -0700, "Jack"
<Jack@discussions.microsoft.com> wrote:

><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">
>Press to enter a New Application
></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>


Quantcast