strange ASP code behaviour
am 09.03.2007 13:46:35 von cmtGreetings
I have a web page with an ASP script in it that is not displaying all
the data from the SQL Server DB correctly in a form.
I have one line in the code, that is doing some strange things.
You can see the code below. The line in question is:
WTacctTotal = objRs("WTacctTotal")
If I move it to the front of the list, it displays the DB info fine
for that line, but for some reason, These lines are missing in the
form:
WTenteredBy = objRS("WTenteredBy")
WTenteredDate = objRS("WTenteredDate")
WTmodifiedBy = objRS("WTmodifiedBy")
WTmodifiedDate = objRS("WTmodifiedDate")
If move it to the end of the list, the above lines display, but then
WTacctTotal doesn't display.
strQry = "select * from worktask where WTid = '" & WTid & "'"
objRS.Open strQry,GetMSSQLConn()
'Response.Write strQry & "
"
WTacctTotal = objRs("WTacctTotal") 'strange line
WTlinkItemID = objRS("WTlinkItemID")
WTtaskTypeID = objRS("WTtaskTypeID")
WTworkEventTypeID = objRS("WTworkEventTypeID")
WTstatusID = objRS("WTstatusID")
WTcompleteByDate = objRS("WTcompleteByDate")
WTbillableAmount = objRS("WTbillableAmount")
WTbudgetAmount = objRS("WTbudgetAmount")
WTbudgetDate = objRS("WTbudgetDate")
WTenteredBy = objRS("WTenteredBy")
WTenteredDate = objRS("WTenteredDate")
WTmodifiedBy = objRS("WTmodifiedBy")
WTmodifiedDate = objRS("WTmodifiedDate")
WToriginalBudgetAmount = objRS("WToriginalBudgetAmount")
WTreductionReason = objRs("WTreductionReason")
WTfreetimeReason = objRs("WTfreetimeReason")
WTextended = objRs("WTextended")
WTmustGo = objRs("WTmustGo").Value
WTweather = objRs("WTweather").Value
WTwaiting = objRs("WTwaiting").Value
objRS.Close
I am displaying the data in a form like this:
value='<%=WTacctTotal%>'>
As you can see, I am doing nothing crazy. Just pulling info from a DB,
assigning variables, then writing out in a form.
I can take the SQL query above, and run it in SQL Query Analyzer, and
verify that the data is there. And it is obviously there, because the
data displays correctly in the form if I move that one line to the
top. But then of course that prevents other lines from being
displayed.
I can't figure out what's going on here!