|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Trapping ADO errors |
From: |
ann |
Date: |
8/8/2000 1:29:01 PM |
IP: |
165.235.86.12 |
Help. Can someone review my code. I want to trap any ADO error and return it as a message that is comprehensiable not
an Microsoft OLE DB error message.
Currently, I have the following code on my global.asa session_onstart:
err.clear
on error resume next
lsConn = session("ConnectionString")
set lconn = server.CreateObject("ADODB.Connection")
lconn.ConnectionString = lsConn
lconn.Open
lsSQL = "SELECT user_id, user_rights FROM csac_users" & _
" WHERE user_id = " & lsUser & ""
set rs = server.CreateObject("ADODB.Recordset")
rs.Open lsSQL, lsConn
set rs = lsConn.Execute(lsSQL)
if err.number>0 then
lsError = "There was an error processing the query. <p>" &_
"The SQL error was: & err.SQLState"
Response.Write(lsError)
end if
p.s. Also, how would I go about showing an image instead of
an error message for any ADO error capture. Thanks for your help. I have been
pounding at this problem for days!!!! |
Follow Up - Re: Trapping ADO errors - mc 8/9/2000 5:01:05 PM
|
|

|
|
|
|
|
|
|
|
|
|