How To Distribute ASP Classic 3.0 And Microsoft Access Web Site

Download and install DWebPro and then place your Web application files in the deploy\www folder (usually C:\DWebPro\deploy\www). Open your Web scripts and edit the Microsoft Access connection string as follows:

<%
Dim DSN, DB_CONN
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
      "DBQ=" & Server.MapPath("Northwind.mdb") & ";" & _
      "UID=admin;PWD=;ReadOnly=1;Exclusive=1;"
Set DB_CONN = Server.CreateObject("ADODB.Connection")
DB_CONN.Open(DSN)
%>

Where Northwind.mdb is your database file.

The last step is burning the deploy (usually C:\DWebPro\deploy) folder on a CD/DVD. See the details of this step in the Distribute PHP/MySQL Web Sites topic. If you need to execute write operations on the Microsoft Access database, you have to configure DWebPro to copy the database files onto the user’s file system. Read the Microsoft Access topic to understand the different ways this can be done. When DWebPro copies the database files onto the user’s file system, it provides way to find the destination folder. Here is sample code to create your own DSN to connect to a Microsoft Access database saved on the user’s file system:

<%
Dim DSN, DB_CONN
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
      "DBQ=" & Request.ServerVariables("DWEBPRO_MSACCESS_DATADIR") & _
      "\Northwind.mdb;UID=admin;PWD=;"
Set DB_CONN = Server.CreateObject("ADODB.Connection")
DB_CONN.Open(DSN)
%>

The ASP Classic 3.0 Support provided by DWebPro contains some differences and many improvements over the one provided from the Microsoft. The main improvements are:

  • New Server objects methods (FileExists, DirectoryExists, EjectCD, LockCD, UnlockCD, IsInternetConnected, MachineID, Encrypt, Decrypt, ReadBinaryFile)

  • Mail object that replicates the CDONTS object behavior

  • Server.Registry object that provides the ability to manipulate the system registry

  • Request.Upload object for handling file upload without needing external COM objects

The 500-100-vb.asp and 500-100-js.asp files residing in the deploy\www folder have the same behavior of the 500-100.asp files of IIS. They are accessed when the ASP engine generates an error (during page parsing or runtime execution). You can customize these error pages to match the style of your Web site. Refer to the How To Personalize The HTTP Error Messages topic for more information on error documents customization.

A Note About ASP.NET

ASP.NET is a Microsoft Technology that represents the next evolution of the Active Server Pages Technology introduced with IIS 3.0 (and enhanced with the successive version of IIS). ASP.NET 1.1 and ASP.NET 2.0 normally require the presence of the Microsoft .NET Framework 1.1 and Microsoft .NET Framework 2.0, respectively.

This can be a huge problem for distributing stand alone Web sites on CD/DVD. Beginning with DWebPro version 6.5.1, we have introduced a new, unique feature that enables you to distribute ASP.NET 2.0 Web sites without requiring the presence of the Microsoft .NET Framework.

This is accomplished by installing the ASP.NET 2.0 Embedded package available from the Add-On page at the DWebPro Web site.