By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,422 Members | 1,282 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,422 IT Pros & Developers. It's quick & easy.

strange ASP code behaviour

P: n/a
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!

Mar 9 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
cmt wrote:
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/database...y-columns.html

--
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.
Mar 9 '07 #2

P: n/a
cmt
On Mar 9, 8:28 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
cmt wrote:
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/database...-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!
Mar 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.