- Moderator
- #1
All right... this isn't making sense, and it's happened to me a few times. There must be a reason for it though.....
I read a recordset from an SQL server... but it seems that after I use a couple of the fields, the rest just "Disappear". Code follows:
Now, the weird thing is... the rs("Consequence") and rs("Violation") are blank when I run this script. HOWEVER, if I put in response.write rs("Violation") immediately AFTER the SQL Query, the information is there!
What the heck??? This is driving me crazy.... any thoughts on why my recordset goes "blank"?
Thanks in advance!
(Note: The above code is not complete.... but that's what I've written so far, when I realized that the recordset data was disappearing... ugh!)
Just my 2¢
-Cole's Law: Shredded cabbage
--Greg
I read a recordset from an SQL server... but it seems that after I use a couple of the fields, the rest just "Disappear". Code follows:
Code:
<%
' impartial review and appeal program
' passes mode = impartial or appeal
' and id = the sequence number of the consequence
strMode = Request.QueryString("mode")
iID = Request.QueryString("id")
Dim cn, cn2, rs
Set cn = Server.CreateObject("ADODB.Connection")
Set cn2 = Server.CreateObject("ADODB.Connection")
cn.Open "DSN=MesabiSQL;Uid=********;Pwd=********;"
cn2.Open "DSN=LoggingSQL;Uid=******;Pwd=*******;"
SQLStmt = "SELECT * FROM LoggingSQL.dbo.Consequence t1 join MesabiSQL.dbo.Youths As t2 on t1.YouthID = t2.YouthID WHERE "
SQLStmt = SQLStmt & "Sequence=" & iID & "; "
Set rs = cn.Execute(SQLStmt)
If rs.BOF and rs.EOF Then
Response.Write "Error! Could not find matching record. Please report the following to MIS:<br>"
Response.Write "/Consequence/Review.asp -- id = " & iID & "; mode=" & strMode & " BOF AND EOF True line 17"
Response.End
End IF
Response.Write "<h3><i>" & rs("YLName") & ", " & rs("YFName") & "</i> - "
If strMode = "impartial" Then
Response.Write "Impartial Review"
Else
Response.Write "Appeal"
End If
Response.Write "</h3><br />"
Response.Write "<strong>Violation:</strong><br>" & rs("Violation")
Response.Write "<br><strong>Original Consequence:</strong><br>" & rs("Consequence")
%>
Now, the weird thing is... the rs("Consequence") and rs("Violation") are blank when I run this script. HOWEVER, if I put in response.write rs("Violation") immediately AFTER the SQL Query, the information is there!
What the heck??? This is driving me crazy.... any thoughts on why my recordset goes "blank"?
Thanks in advance!
(Note: The above code is not complete.... but that's what I've written so far, when I realized that the recordset data was disappearing... ugh!)
Just my 2¢
-Cole's Law: Shredded cabbage
--Greg