In this example, ged will be Empty, even though the column in the
table contains a valid date.
By accessing the GraceEndDate first, both values will be displayed
properly:
Dim rs, ext, ged
rs = dbConnection.Execute("select * from tblDemo where PIN = '9'")
ged = rs("GraceEndDate")
ext : ext = rs("Extension")
ged : ged = rs("GraceEndDate")
Response.Write("ext: " & ext & ". ged: " & ged)
Or, if we specify all the column names in the select statement, the
value will not be lost:
Dim rs, ext, ged
rs = dbConnection.Execute("select Extension, GraceEndDate from
tblDemo where PIN = '9'")
ext : ext = rs("Extension")
ged : ged = rs("GraceEndDate")
Response.Write("ext: " & ext & ". ged: " & ged)
The database we're accessing is SQL Server 2000. We're programming in
Classic ASP, with an IIS 5.0 server.
Does anyone know why the column is being trashed?
Does anyone have a better workaround than the ones here (accessing the
date before it gets lost, or specifying all the columns instead of
using *)?
Thanks in advance.
-Ken
You wouldn't happen to have an 'On Error Resume Next' line somewhere in the
ASP code would you? - Just a curiosity thing - I'm wondering if there are
any errors that may be occurring when you try to access the Extension field
first.
What are the datatypes of the fields you mentioned? Does it matter if you
access data from any other fields?
I agree that this is odd, but it is strangely familiar.
Regards,
John Boatner
MCSD, MCDBA, MCSE, MCSA, MCDST
J2 Technologies, Inc.
http://www.j2tech.com
"Ken" <kenneth...@nelnet.net> wrote in message
news:1d0f453b.04040...@posting.google.com...
After looking into it further, if I access any column "to the right
of", or "after" GraceEndDate before accessing GraceEndDate, the
GraceEndDate is lost. So it is not the Extension column per se that is
causing the problem.
The data type of GraceEndDate is datetime. Extension is a varchar.
Some of the other columns that trash the date are bit and char.
I've tried this with several rows from the table, and they all produce
the same same symtpoms. I.e., its not a particular value of the
Extension or Grace End Date that matters.
"John Boatner, MCSD, MCDBA, MCSE, MCSA, MCDST" <john.boatner@-nospam-
j2tech.com> wrote in message news:<kmKcc.3813$ZJ6....@bignews5.bellsouth.net>...
--
Regards,
John Boatner
MCSD, MCDBA, MCSE, MCSA, MCDST
J2 Technologies, Inc.
http://www.j2tech.com
"Ken" <kenneth...@nelnet.net> wrote in message
news:1d0f453b.04040...@posting.google.com...