|
 |
access_asp thread: ADO error checking
Message #1 by "A Morgan" <mail4akm@y...> on Sun, 10 Mar 2002 01:58:09
|
|
What is the best way to check for ADO connection and SQL errors(ie,
misspelled column name)? I've tried the count property (discussed in
Beginning ASP 3.0) of the errors collection and found there is always an
error object created, even when the SQL executes correctly. The code and
field values from the error object are:
set objConn = Server.CreateObject("ADODB.Connection")
objConn.errors.clear
objConn.Open "eMarketing"
if objConn.errors.count > 0 then
call CheckError(objConn)
end if
error number: 0
error description: [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed
error source: Microsoft OLE DB Provider for ODBC Drivers
SQL error code: IM006
database error code: 0
Anita
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 11 Mar 2002 10:55:31 +1100
|
|
misspelt column names should only be a problem during development.
If you take on On Error Resume Next you will see a big glaring error
whenever you mis-spell a column name. Once you have the column names
correct, you shouldn't have a problem anymore...
In terms of the actual error message you are receiving, please read KB
article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q197459
I suggest you change from using the ODBC driver to the native OLEDB Provider
for the database that you have, since that seems the simplest method of
making the problem go away. Connection strings can be found here:
www.able-consulting.com/ado_conn.htm
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "A Morgan" <mail4akm@y...>
To: "Access ASP" <access_asp@p...>
Sent: Sunday, March 10, 2002 1:58 AM
Subject: [access_asp] ADO error checking
: What is the best way to check for ADO connection and SQL errors(ie,
: misspelled column name)? I've tried the count property (discussed in
: Beginning ASP 3.0) of the errors collection and found there is always an
: error object created, even when the SQL executes correctly. The code and
: field values from the error object are:
:
: set objConn = Server.CreateObject("ADODB.Connection")
: objConn.errors.clear
: objConn.Open "eMarketing"
: if objConn.errors.count > 0 then
: call CheckError(objConn)
: end if
:
: error number: 0
: error description: [Microsoft][ODBC Driver Manager] Driver's
: SQLSetConnectAttr failed
: error source: Microsoft OLE DB Provider for ODBC Drivers
: SQL error code: IM006
: database error code: 0
:
: Anita
:
:
:
:
$subst('Email.Unsub').
Message #3 by "A Morgan" <mail4akm@y...> on Tue, 12 Mar 2002 23:54:54
|
|
> misspelt column names should only be a problem during development.
>
> If you take on On Error Resume Next you will see a big glaring error
> whenever you mis-spell a column name. Once you have the column names
> correct, you shouldn't have a problem anymore...
>
> In terms of the actual error message you are receiving, please read KB
> article:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q197459
> I suggest you change from using the ODBC driver to the native OLEDB
Provider
> for the database that you have, since that seems the simplest method of
> making the problem go away. Connection strings can be found here:
> www.able-consulting.com/ado_conn.htm
>
> Cheers
> Ken
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ----- Original Message -----
> From: "A Morgan" <mail4akm@y...>
> To: "Access ASP" <access_asp@p...>
> Sent: Sunday, March 10, 2002 1:58 AM
> Subject: [access_asp] ADO error checking
>
>
> : What is the best way to check for ADO connection and SQL errors(ie,
> : misspelled column name)? I've tried the count property (discussed in
> : Beginning ASP 3.0) of the errors collection and found there is always
an
> : error object created, even when the SQL executes correctly. The code
and
> : field values from the error object are:
> :
> : set objConn = Server.CreateObject("ADODB.Connection")
> : objConn.errors.clear
> : objConn.Open "eMarketing"
> : if objConn.errors.count > 0 then
> : call CheckError(objConn)
> : end if
> :
> : error number: 0
> : error description: [Microsoft][ODBC Driver Manager] Driver's
> : SQLSetConnectAttr failed
> : error source: Microsoft OLE DB Provider for ODBC Drivers
> : SQL error code: IM006
> : database error code: 0
> :
> : Anita
> :
> :
> :
> :
> $subst('Email.Unsub').
>
|
|
 |