strange ASP code behaviour

C

cmt

Greetings

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 & "<br>"
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:

<input type='text' size='20' class='controls' name='WTacctTotal'
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!
 
B

Bob Barrows [MVP]

cmt said:
Greetings

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:

It's an old ODBC bug, so you should start by following this advice:
http://www.aspfaq.com/show.asp?id=2126

And then read this:
http://www.aspfaq.com/show.asp?id=2096

And this:
http://databases.aspfaq.com/databas...memo-text-hyperlink-and-currency-columns.html
 
C

cmt

It's an old ODBC bug, so you should start by following this advice:http://www.aspfaq.com/show.asp?id=2126

And then read this:http://www.aspfaq.com/show.asp?id=2096

And this:http://databases.aspfaq.com/database/how-do-i-deal-with-memo-text-hyp...

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

OMG...that was it. Instead of using SELECT *, I named all the columns
individually and put the offending column WTacctTotal at the end. It
worked! -THANKS!
 

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,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top