Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=120200057

Source / File / Line / Column

ASPError Object

One of the key functions of ASPError is the file related error information

Source Property

The source property is read only property to retrieve the actural source code, if available,  of the line that caused the error. 

Syntax:

ASPError.Source()

Or in ASP file. Imply

<% ASPError.Source()  %>

Parameters:

void

This property has no parameters.

Return Values:

string

String contains the actual source text causing the error

Remarks:

The displaying of source in pages that causing the error may also be viewable by anyone.

File Property

The File property is read only property to retrieve the name of the ASP file that generated the error during script processing. 

Syntax:

ASPError.File()

Or in ASP file. Imply

<% ASPError.File()  %>

Parameters:

void

This property has no parameters.

Return Values:

string

String contains the name of ASP file causing the error

Line Property

The Line property is read only property to retrieve the line of the ASP page that caused the error.

Syntax:

ASPError.Line()

Or in ASP file. Imply

<% ASPError.Line()  %>

Parameters:

void

This property has no parameters.

Return Values:

long integer

Long integer contains the number of line in the ASP file causing the error

Column Property

The Column property is read only property to retrieve the column position of the ASP page that caused the error.

Syntax:

ASPError.Column()

Or in ASP file. Imply

<% ASPError.Column()  %>

Parameters:

void

This property has no parameters.

Return Values:

long integer

Long integer contains the column position in the ASP file causing the error

Link:http://output.to/sideway/default.asp?qno=120200058

ASPCode / ASPDescription / Category / Number

ASPError Object

One of the key functions of ASPError is the error related information

ASPCode Property

The source property is read only property to retrieve the error code generated by the web server.

Syntax:

ASPError.ASPCode()

Or in ASP file. Imply

<% ASPError.ASPCode()  %>

Parameters:

void

This property has no parameters.

Return Values:

string

String contains the error code generated by IIS

ASPDescription Property

The ASPDescription property is read only property to retrieve a more detailed description of the error that related to the ASP engine.

Syntax:

ASPError.ASPDescription()

Or in ASP file. Imply

<% ASPError.ASPDescription()  %>

Parameters:eters:

void

This property has no parameters.

Return Values:

string

String contains the short description of the error

Category Property

The Category property is read only property to retrieve the category of the error source. A error can be generated by the ASP engine of the web server, the scripting language, or the object or component of ASP.

Syntax:yntax:

ASPError.Category()

Or in ASP file. Imply Imply

<% ASPError.Category()  %>

Parameters:

void

This property has no parameters.

Return Values:

string

String contains the name of source type causing the error

Description Property

The Description property is read only property to retrieve a string that describes the error.

Syntax:yntax:yntax:

ASPError.Description()

Or in ASP file. Imply

<%ASPError.Description()  %>

Parameters:eters:

void

This property has no parameters.

Return Values:

String

String contains a short description of the error.

Number Property

The Number property is read only property to retrieve the standard COM error code generated by the COM component.

Syntax:yntax:

ASPError.Number()

Or in ASP file. Imply Imply

<% ASPError.Number()  %>

Parameters:

void

This property has no parameters.

Return Values:

long integer

Long integer contains the standard COM error code generated by a COM component causing the error.

Remarks:

When decyphering a COM error code, convert the number to hexidecimal, examine the last 8 digits, and use the instructions at Structure of COM Error Codes to understand what the error is. For example, the error -2146828277 converts to FFFFFFFF800A000B in hexidecimal. The 8 represents FACULTY_WINDOWS: Used for additional error codes from Microsoft-defined interfaces, the A represents Visual Basic, and the B represents decimal 11 which is the Visual Basic error code for a "divide by zero" error. For a list of COM error codes, see System Error Codes.

Link:http://output.to/sideway/default.asp?qno=120200055

OnTransactionAbort / OnTransactionCommit

ObjectContext Object

The key functions of ObjectContext is the transaction control on the server.

OnTransactionAbort Event

OnTransactionAbort Event occurs when the transaction has been aborted for whatever reason or processing error. An optional corresponding event subroutine with the reserved name OnTransactionAbout can be used to handle the case of about event occur. 

Syntax:

<%@ TRANSACTION=Required  LANGUAGE=ScriptLanguage%>
<%
Sub OnTransactionAbort
    ...Script...
End Sub
%>

 Or in ASP file. Imply

<%@ TRANSACTION=Required  LANGUAGE=ScriptLanguage%>
<%
Sub OnTransactionAbort
    ...Scripts...
End Sub
%>

Parameters:

ScriptLanguage

The parameter "ScriptLanguage" is used to specify the scripting language used in writing the event script.

Script

The parameter "Script" is the program written by the scripting language for the script interpreter of the Web Server.

Remarks:

The OnTransactionAbout subroutine is an optional event subroutine will be processed by the web server when the transaction is aborted.

Examples:

  • Use OnTransactionAbort Event to handle the transaction on abort

    ASP script command:

    <%@ TRANSACTION=Required  LANGUAGE=ScriptLanguage%>
    <%
    If reqqty>stock then
    ObjectContext.SetAbort
    end if
    Sub OnTransactionAbort
        Response.Write "Transaction Abort"
    End Sub
    %>

OnTransactionCommit Event

OnTransactionCommit Event occurs when the transaction has been committed or completed without any processing error. An optional corresponding event subroutine with the reserved name OnTransactionCommit can be used to handle the case of completed or committed event occur..

Syntax:

<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
<%
Sub OnTransactionCommit
    ...Script...
End Sub
%>

 Or in Global.asa. Imply

<SCRIPT LANGUAGE=ScriptLanguage RUNAT=Server>
<%
Sub OnTransactionCommit
    ...Scripts...
End Sub
%>

Parameters:

ScriptLanguage

The parameter "ScriptLanguage" is used to specify the scripting language used in writing the event script.

Script

The parameter "Script" is the program written by the scripting language for the script interpreter of the Web Server.

Remarks:

The OnTransactionCommit subroutine is an optional event subroutine will be processed by the web server when the transaction is completed.

Examples:

  • Use OnTransactionCommit Event to handle the transaction on commit

    ASP script command:

    <%@ TRANSACTION=Required  LANGUAGE=ScriptLanguage%>
    <%
    If reqqty>stock then
    ObjectContext.SetAbort
    else
     ObjectContext.SetComplete
    end if
    Sub OnTransactionAbort
        Response.Write "Transaction Abort"
    End Sub
    Sub OnTransactionCommit
        Response.Write "Transaction Complete"
    End Sub
    %>

Previous Month  FEB  2012  Next Month
SMTWTFS
1234
567891011
12131415161718
19202122232425
26272829

Previous Month  JUL  2015  Next Month
SMTWTFS
1234
567891011
12131415161718
19202122232425
262728293031

Sideway BICK Blog

14/02


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013