ADO Connection Object error object .description member unobtainable
Posted on 2007-07-26
I am trying to access the .Description property of an error object within the set of them in a ADO connection object. I am able to get the value of its SQLState property and return it in a response string but
when I tried to do the same for .Description, it does not seem to return a valid string...
I can also return OK the values of the .Number and .HelpFile datamembers in this string but not the .Description
I must be missing something fundamental here or there is no valid description value for the error I am encountering...the DB in question is MS Sql Server
set conn = Server.CreateObject("ADODB.Connection")
' next line opens DB ok (details omitted)
' I intentionally cause an error by using a non exist table
sqlStr = "Insert into tblActiveUnitsxxx (TrkID) Values ('00" + Trim(CStr(unitID)) + "')"
if conn.Errors.Count > 0 then
set objErr = Server.CreateObject("ADODB.Error")
markerText = "<marker strError='"&conn.Errors.Count&"'/>"
for each objErr in conn.Errors
if objErr.Number <> 0 then
markerText = "<marker strError='"&objErr.Description&"'/>"
'markerText = "<marker strError='"&objErr.SQLState&"'/>"