Name
Description (Error Object) —
objError
.Description
Synopsis
A read-only string that provides textual information describing the error that the underlying data provider raised in response to incorrect syntax or lack of support. Description is a property of each Error object in the Connection object's Errors collection. It is not the same as the Description property of the ASP Err object.
Parameters
None
Example
The following example demonstrates the use of the Description
property of the Error object. Notice that for this example to work
properly, the Response object's Buffer property must be set to
True because we use the Response's Clear and
End methods.
<%@ LANGUAGE="VBSCRIPT" %> <%Response.Buffer = True%> <HTML> <HEAD> <TITLE>ADO Examples</TITLE> </HEAD> <BODY> <% ' Include ADOVBS.INC so we can use the ADO constants. %> <!-- #include virtual = "/MySSIncludes/adovbs.inc" --> <% ' Instantiate an ADO Connection object. Set objDBConn = Server.CreateObject("ADODB.Connection") ' Construct the connection string for the Connection object. strConn = _ "driver={MyDBType};;uid=sa;pwd=;database=SalesDB" ' Using the connection string, open the connection. objDBConn.Open strConn ' Check if attempting to open a connection to the ' provider resulted in ADO adding Error objects to the ' Connection's Errors collection. If objDBConn.Errors.Count > 0 Then ' An error occurred and ADO added an Error object to ' the Connection's Errors collection. Clear the ' Response buffer and alert the user of ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access