Register Now! Download Now! ASPFast

Home

Features

Performance

Download

Register

Documentation

Support

ASPFast User Guide and Reference
Download www.ASPFast.com Register

Setup
Quickstart
Reference
   Setting Properties
   Methods Reference
   Properties Reference

Setup
Copy the ASPFast.dll to your ASP server running IIS on Windows 2000 and register it using regsvr32.exe. If you are running an NT 4 server you will should read the NT 4 addendum. The customary location for COM servers (like ASPFast) is in the System32 folder under the Windows folder but it can be installed anywhere. You will need to be logged on as an Administrator to use the regsvr32.exe program.

Quickstart Instructions
In your ASP page create an instance of ASPFast like this:
<%
Dim oASPFast
Set oASPFast = Server.CreateObject("ASPFast.Fast")
%>

Reference

Setting Properties
Setting properties allows you to change the behavior and customize the output from ASPFast. Properties can be set 4 ways:

1.  In code.
Properties are set with the SetProperty method. The syntax is:

oASPFast.SetProperty sProperty, vValue, Optional sKey

sProperty is the name of the property. It should be a string data type. (enclosed in quotes)
vValue
is the value you want to set the property to. The data type varies.
sKey is only used to set some special properties. It should be a string data type. (enclosed in quotes)

2.  Via ASP Application Variables.
Most properties can be set via application variable either in the global.asa file or in an ASP page. The syntax is:

Application.Variables("Property Name") = PropertyValue

"Property Name" is the name of the property. It should be a string data type. (enclosed in quotes)
PropertyValue is the value you want to set the property to. The data type varies.

Properties that require a Key value cannot be set with an application variable.

3.  Using a text "ini" file.
If a text file names ASPFast.ini is found in the same folder as the ASPFast.dll, it is checked for for variables. The syntax is:

Property Name=Property value

Property Name is the name of the property. (no quotes)
PropertyValue is the value you want to set the property to. (no quotes)

The INI_PATH property can be set to read an ini file with another name or in another folder. Multiple ini files can be read.

4.  Passed as an array.
Multiple properties can be set at one time by putting them into an array and passing the array into a property named "PROPERTY_ARRAY". Also some methods have a PropertyArray parameter that accepts an array of properties that are set in a stateless manner for greater performance. The syntax is:

oASPFast.SetProperty "PROPERTY_ARRAY", aProps

The syntax for creating the array is:

Dim aProps(# of properties to set, 2)
aProps(property #, 0) = "Property Name"
aProps(property #, 1) = "Property Value"
aProps(property #, 2) = "Optional Key"

 

Methods Reference

TableFromQuery
Parameters / Datatype:
Query / String (enclose in quotes)
The SQL query that is converted into a HTML table.
PropertyArray (Optional) / Array
See PROPERTY_ARRAY property.

Return Datatype:  String
This is the main method for quickly creating HTML tables from a SQL query. For stateless performance all properties can be set in the this call by passing an optional array of properties. See PROPERTY_ARRAY property for details and the ASPFast website for examples.

Example:
Response.Write oASPFast.TableFromQuery("Select * from Customer")
Output HTML:
See examples page at www.ASPFast.com.

TableFromRS
Parameters / Datatype:
rs / recordset
An ADO recordse that is converted into a HTML table.
PropertyArray (Optional) / Array
See PROPERTY_ARRAY property.

Return Datatype:  String
This Method is exactly the same as the TableFromQuery except a recordset is passed instead of a query.
Example:
Response.Write oASPFast.TableFromRS(MyRS)
Output HTML:
See examples page at www.ASPFast.com.

Email
To / String (enclose in quotes)
Email address of recipient. Multiple addresses are separated with commas.
From / String (enclose in quotes)
Email address of sender.
Subject / String (enclose in quotes)
Email subject line.
Body / String (enclose in quotes)
Email body.
EmailComponent (Optional) / Array
The name of the email object you wish to use. Currently supported are "DUMAS" and "CDONTS".
Return Datatype:  Boolean
This method is a wrapper for an existing email object. It does not send the email without the help of a separate email object. I discovered the need for this is method when my web hosting company changed mail software and replaced the CDONTS.DLL mail object with ASP Mail. All of a sudden I had to change my ASP code in a zillion places. With this wrapper function the mail object can be specified (or changed) in a single line in the global.asa or ASPFast.ini file and your ASP code can stay the same. Currently supported email objects are Microsoft CDONTS.DLL and the Dumas Email Object. Other email objects can be added on request or easily configured if you purchase the source code. See EMAIL_COMPONENT property for more information.
Example:
oASPFast.Email("john@acme.com", "help@aspfast.com", "This is the subject...", "This is the message body...")
Output HTML:
None

Str2SQL
Text  / String (enclose in quotes)
NoComma (Optional) / Boolean (True / False)
Return Datatype:  String
This method fixes a string to use in a SQL statement by doing the following:
1. Replace the single quote character (') with two single quotes ('').
2. Add a single quote to the beginning and end of the string.
3. Add a comma to the end of the string unless the NoComma parameter is set to True.
Daniel's ASPFast becomes 'Daniel''s ASPFast',
This prevents database errors trying to insert strings with embedded single quotes.
Writing this query:
SQL = "Insert Into Customer (Name, Address, City ) Values ( " & "'" & Replace(sName, "'","''") & "'," & Replace(sAddress), "'","''") & "'," & Replace(sCity), "'","''") & "')"
becomes:
SQL = "Insert Into Customer (Name, Address, City ) Values ( " & oFast.Str2SQL(sName) & oFast.Str2SQL(sAddress) & oFastDAH.Str2SQL(sCity, True) & ")"
This extra simplicity helps prevent bugs in your code and saves some time writing code.

Properties Reference

Table Appearance Properties

TABLE_TAG
Datatype:  String (enclose in quotes)
Default Value:  <TABLE>
Allows using a custom table tag with extra attributes instead  the default <TABLE> tag. When passing a quote (") character in a string parameter use a two quote ("") characters. When this property is set the CSS_TABLE property is ignored so to include a style sheet class in the table tag include the "class=" attribute in the tag. (see example)
Example:
oASPFast.SetProperty "TABLE_TAG", "<TABLE WIDTH=""80%"" class=""MyStyle"""
Output HTML:
<TABLE WIDTH="80%" CLASS="MyStyle">

CSS_TABLE
Datatype:  String (enclose in quotes)
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in the <TABLE> tag.
Example:
oASPFast.SetProperty "CSS_TABLE", "MyStyle"
Output HTML:
<TABLE CLASS="MyStyle">

CSS_ALLROWS
Datatype:  String (enclose in quotes)
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in every Table Row <TR> tag.
Example:
oASPFast.SetProperty "CSS_ALLROWS", "MyStyle"
Output HTML:
<TR CLASS="MyStyle">

CSS_EVEN_ROWS
Datatype:  String (enclose in quotes)
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in every even numbered Table Row <TR> tag. This is used to create tables with alternating colored rows.
Example:
oASPFast.SetProperty "CSS_EVEN_ROWS", "MyStyle"
Output HTML (on the even rows):
<TR CLASS="MyStyle">

CSS_ODD_ROWS
Datatype:  String (enclose in quotes)
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in every odd numbered Table Row <TR> tag. This is used to create tables with alternating colored rows.
Example:
oASPFast.SetProperty "CSS_ODD_ROWS", "MyStyle"
Output HTML (on the odd rows):
<TR CLASS="MyStyle">

CSS_HEADER_ROW
Datatype:  String (enclose in quotes)
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in the first Table Row <TR> tag.
Example:
oASPFast.SetProperty "CSS_HEADER_ROW", "MyStyle"
Output HTML (on the first row):
<TR CLASS="MyStyle">

CSS_COLUMN
Datatype:  String (enclose in quotes)
Default Value:  None
Requires Key Parameter
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in a single column <TD> tag. The key is set to indicate which column to apply the style to. (0 based - leftmost column is 0) This can be used to create tables with alternating colored columns and other effects.
Example:
oASPFast.SetProperty "CSS_COLUMN", "MyStyle", "1"
Output HTML (on the second column):
<TD CLASS="MyStyle">

COLUMN_FORMAT
Datatype:  String (enclose in quotes)
Default Value:  None
Requires Key Parameter
Default Value:  None
Sets the formatting for money. date or image data in a single column. The key is set to indicate which column to apply the style to. (0 based - leftmost column is 0) Value can be "M" for money, "D" for date and "I" for and image. See MONEY_FORMAT and DATE_FORMAT properties to change the way these are displayed.
Example:
oASPFast.SetProperty "COLUMN_FORMAT", "D", "1"
Output HTML (on the second column):
<TD>July 1, 1988</TD>

MONEY_FORMAT
Datatype:  String (enclose in quotes)
Default Value:  "$###,###,###,##0.00"
The Visual Basic format string used by the COLUM_FORMAT property when it's value is set to "M" (money). 
Example:
oASPFast.SetProperty "MONEY_FORMAT", "###,###"
Output HTML (on money formatted data):
<TR>
<TD>123,456</TD>
</TR>

DATE_FORMAT
Datatype:  String (enclose in quotes)
Default Value:  ""mm/dd/yy""
The Visual Basic format string used by the COLUM_FORMAT property when it's value is set to "D" (date). 
Example:
oASPFast.SetProperty "DATE_FORMAT", "mmm, yyyy"
Output HTML (on date formatted data):
<TR>
<TD>Jan, 1998</TD>
</TR>

TABLE_HEADER_DATA
Datatype:  String (enclose in quotes)
Default Value:  Recordset field names
A comma delimited string containing the text to be displayed in each column of the first row. If not set the field names from the are used by default. Setting this property to an empty string ("") will cause the header row to be skipped.
Example:
oASPFast.SetProperty "TABLE_HEADER_DATA", "Name,City,State"
Output HTML (on the first row):
<TR>
<TD>Name</TD><TD>City</TD><TD>State</TD>
</TR>

NO_HEADER_IF_EMPTY
Datatype:  Boolean (True / False)
Default Value:  False
Directs ASPFast to not write a table if the query returns no rows. The default behavior for empty queries is to create a table with only a header row.
Example:
oASPFast.SetProperty "NO_HEADER_IF_EMPTY", True
Output HTML:
None

CONNECT_STRING
Datatype:  String (enclose in quotes)
Default Value:  None
The ADO database connect string needed to access your database.
Examples:
oASPFast.SetProperty "CONNECT_STRING", "Data Source=Pubs; User ID=sa; Password=*****;"
oASPFast.SetProperty "CONNECT_STRING", "
DSN=Pubs;UID=sa; PWD=****;
oASPFast.SetProperty "CONNECT_STRING", "
driver={SQL Server}; server=bigsmile; uid=sa; pwd=****; database=pubs"
Output HTML:
None

Paged Table Properties

CSS_NAVIGATION_BUTTONS
Datatype:  String (enclose in quotes)
Default Value:  None
Sets the Cascading Style Sheet (CSS) class that is set in the Navigation <FORM> tag.
Example:
oASPFast.SetProperty "CSS_NAVIGATION_BUTTONS", "MyStyle"
Output HTML:
<FORM CLASS="MyStyle">

PAGE_SIZE
Datatype:  Number
Default Value:  0
Sets the maximum number of table rows to display. The default value of 0 shows all rows and removes the navigation controls.
Example:
oASPFast.SetProperty "PAGE_SIZE", 10
Output HTML:
None

PAGE_NUMBER
Datatype:  Number
Default Value:  1
Sets the table page number to display if PAGE_SIZE is set greater than 0.
Example:
oASPFast.SetProperty "PAGE_NUMBER", 3
Output HTML:
None

Debugging / Error Handling Properties

LAST_ERROR
Read Only Property

Datatype:  String
Default Value:  N/A
Returns a description of the most recent error that occured.
Example:
oASPFast.GetProperty("LAST_ERROR")
Output HTML:
None

ALL_ERRORS
Read Only Property

Datatype:  String
Default Value:  N/A
Returns a list of all errors that have occurred since the current instance of the ASPFast object was created.
Example:
oASPFast.GetProperty("ALL_ERRORS")
Output HTML:
None

PROPERTY_NAMES_ARRAY
Read Only Property

Datatype:  Array
Default Value:  N/A
Returns an array of the names of all available properties.
Example:
oASPFast.GetProperty("PROPERTY_NAMES_ARRAY")
Output HTML:
None

PROPERTY_NAMES_LIST
Read Only Property

Datatype:  String
Default Value:  N/A
Returns a comma delimited string of the names of all available properties.
Example:
oASPFast.GetProperty("PROPERTY_NAMES_LIST")
Output HTML:
None

PROPERTY_VALUES_ARRAY
Read Only Property
Datatype:  Array
Default Value:  N/A
Returns an array of the values of all set properties.
Example:
oASPFast.GetProperty("PROPERTY_VALUES_ARRAY")
Output HTML:
None

PROPERTY_VALUES_LIST
Read Only Property
Datatype:  String
Default Value:  N/A
Returns a comma delimited string of the values of all set properties.
Example:
oASPFast.GetProperty("PROPERTY_VALUES_LIST")
Output HTML:
None

PROPERTY_TABLE
Read Only Property
Datatype:  String
Default Value:  N/A
Returns a formatted HTML table of the names and values of all set properties.
Example:
oASPFast.GetProperty("PROPERTY_TABLE")
Output HTML:
 

DEBUG
Datatype:  Boolean (True / False)
Default Value:  True
Writes error and other data to a file names ASPFast.log in the same folder as ASPFast.dll.
Example:
oASPFast.SetProperty "DEBUG", True
Output HTML:
None

Performance Properties

SKIP_INI
Datatype:  Boolean (True / False)
Default Value:  False
Directs ASPFast to skip checking the default ASPFast.ini file. This may improve performance in some situations.
Example:
oASPFast.SetProperty "SKIPINI", True
Output HTML:
None

SKIP_APPLICATION_VARIABLES
Datatype:  Boolean (True / False)
Default Value:  False
Directs ASPFast to skip checking ASP Application variables. This helps ASPFast run on Windows NT 4 servers with the older versions of IIS.
Example:
oASPFast.SetProperty "SKIPINI", True
Output HTML:
None

Miscellaneous Properties

INI_PATH
Datatype:  String (enclose in quotes)
Default Value:  None
By default the folder with  ASPFast.dll is checked (see SKIP_INI). Set the INI_PATH property to read an alternate file instead. Use the full file system path and file name (not IIS virtual directory path).
Example:
oASPFast.SetProperty "INI_PATH", "C:\Windows\MyINI.ini"
Output HTML:
None

EMAIL_COMPONENT
Datatype:  String (enclose in quotes)
Default Value:  CDONTS
Sets the email component used by the EMAIL method. Components supported at this time are CDONTS and DUMAS.
Example:
oASPFast.SetProperty "EMAIL_COMPONENT", "DUMAS"
Output HTML:
None

VERSION
Read Only Property

Datatype:  String
Default Value:  N/A
Returns the version number of the ASPFast.dll.
Example:
oASPFast.GetProperty("VERSION")
Output HTML:
None

CLEAR_ALL_PROPERTIES
Write Only Property

Datatype:  Boolean (True / False)
Default Value:  N/A
Resets all properties to default values.
Example:
oASPFast.SetProperty "CLEAR_ALL_PROPERTIES", True
Output HTML:
None

PROPERTY_ARRAY
Write Only Property

Datatype:  Array
Default Value:  N/A
Used to set multiple properties with a single call.
Example:
oASPFast.SetProperty "PROPERTY_ARRAY", aProps
Output HTML:
None

Encrypt(sText as String) as String
Decrypt(sText as String) as String
These methods perform simple text encryption and decryption. An optional key can be specified in the global.asa file to make the encryption more secure. Remember that this is simple encryption - not intended for state secrets.

Logon / CheckLogon

Validate(sValue as String, sType as String) as Boolean
This method is used to check that a value (usually user entered into a form) corresponds to a particular data type. The data to be checked is passed in the sValue parameter and the sType indicates the desired data type, either "N" for number or "D" for date.

 

Copyright ©2003 Daniel Biener
All rights reserved.
Home  Features  Home  Performance  Home  
Download  Register  Documentation  Support  Home