Name

Source (Error Object) — objError .Source

Synopsis

A string value that represents the name of the application or object that caused ADO or the underlying data provider to add an Error object to the Errors collection of the Connection object.

Parameters

None

Example

<%@ 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 to see 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 the error. Response.Clear Response.Write _ "One or more errors have occurred.<BR>" For intCounter = 0 to objDBConn.Errors.Count Response.Write "The " & intCounter & " error's " Response.Write "error number is " & _ ojDBConn.Errors(intCounter).Number & ".<BR>" Response.Write "The description for this " Response.Write "error is <BR>" & _ ojDBConn.Errors(intCounter).Description & _ ".<BR>" ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.