On my dev machine, on which I test, I have essentially the client, db, and
web server on machine. I started getting an error today that I just don't
get.
===========
Error Type:
(0x80020009)
Exception occurred.
/DisplaySortableTickets.asp, line 982
Page:
GET /DisplaySortableTickets.asp
================
Now, here's the kicker: I haven't made any changes to this page at all.
None. Nor the database, the machine, the RAM, didn't install any new
software, nothing. And since it's my machine, I am sure that nobody else
has, either. Still, I get this error, on two different pages, and there is
similar code on both, which the line number points to:
====================
Set rsHistory = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT EmployeeID,TIMESTMP,BriefDesc AS HistBriefDesc,LongDesc AS
HistLongDesc,InternalDesc AS HistInternalDesc,Status AS
HistStatus,EmailSentTo, ActionItem,Source,Contact_CustID "
strSQL = strSQL & "FROM TKT_History "
strSQL = strSQL & "WHERE TicketID = '"&strTicketID&"' "
'to skip showing the first history item, which should be entered when ticket
is created
strSQL = strSQL & "AND BriefDesc <> 'Initial Entry' "
strSQL = strSQL & "ORDER BY TIMESTMP ASC "
rsHistory.Open strSQL, objConnection,1,1
If not rsHistory.eof then
%>
<tr>
<td bgcolor="#999999" colspan="5"><span class="celltitle">Work
History:</span></td>
</tr>
<%
Do Until rsHistory.EOF
strEmployeeID = rsHistory("EmployeeID")
strTIMESTMP = rsHistory("TIMESTMP")
strHistBriefDesc = rsHistory("HistBriefDesc")
strHistLongDesc = rsHistory("HistLongDesc")
strHistInternalDesc = rsHistory("HistInternalDesc")
strHistStatus = rsHistory("HistStatus")
strEmailSentTo = rsHistory("EmailSentTo")
strActionItem = rsHistory("ActionItem")
strHSource = rsHistory("Source")
strHistCust = rsHistory("Contact_CustID")
if strHistCust <> "" then
Set RSHistCust = Server.CreateObject("ADODB.Recordset")
If strHSource = "E" then
strSQL = "SELECT FirstName, LastName FROM Contact "
strSQL = strSQL & "WHERE ContactID = '"&strHistCust&"' "
RSHistCust.Open strSQL, objConnection,1,1
strHistCustName = RSHistCust("FirstName")&" "&RSHistCust("LastName")
(the last line above is line 981)
====================
FWIW, I am using SQL Server 2000.
Of course, I went to the MS KB, and didn't really find anything that seemed
to apply to my case. I also went to www.aspfaq.com, and looked at several
things, but most of them didn't seem to apply, either. The one that might
contain my answer was http://www.aspfaq.com/show.asp?id=2188
At the top of that page, it says to:
--avoid using SELECT * -- I didn't have that problem
--Assign the value of the column to a variable IMMEDIATELY, and only use
this variable from that point on -- I did this already
--Make sure your MDAC drivers are most current --- I don't know how to do
this, but seriously, how could this code work for weeks or months and then
the MDAC start becoming a problem?
--check out a couple of MS KB articles. I checked them out, not sure how
they apply to my situation, unless I am missing something.
I'm not sure what a blob is (is that the image, or binary datatype?)
But the fields it points to are the First name and Last name fields, and
those are both Varchars, size 50.
In my testing around, I also changed from Post to Get, and that didn't make
a difference.
I also did a response.write of the SQL command, then ran it in SQL Server,
and it ran just fine, producing exactly one row.
I am rebooting the machine right now. Can anyone help me track this down?