_2020applications_connection.asp

What does this file do?

The _2020applications_connection.asp file contains variables and information required to build the connection string used to connect to the 20/20 DataShed database. This file is modified automatically by the "Database Utilities" interface, but may also be edited manually in a text editor such as Notepad.

Permissions and Security

Server

This file may inherit the permissions from its parent folder; but also requires that the IUSR_<localmachinename> (or equivalent) user account have NTFS permissions to read and modify the contents of the file.

For comprehensive NTFS file and folder permission settings please see File/Folder Security (NTFS Permissions).

Internal

This file does not require internal security measures.

How to Maintain

This file does not require maintenance. However, if you have altered the connection string or the properties made available in the "Database Utilities" interface, then we recommend that you make a backup copy of both the original and the modified copy.

Included In (Files)

This file is included (via SSI) in the following:

Inherits (Files)

The following files are available (via SSI) in _2020applications_connection.asp:

How to Customize

If using a Microsoft Access database, we recommend this file should not be edited manually. Instead we encourage you to use the "Database Utilities" interface to control the variables available in this file.

However, in some cases (such as those using SQL Server) it may be necessary to adjust this file manually.

If it's necessary to alter this file manually, then follow these steps:

  1. Access your web site with an FTP application such as CuteFTP, FTP Explorer, or Windows "My Network Places".
  2. Download _2020applications_connection.asp from the parent folder of this application to your local computer.
  3. Open "_2020applications.asp" in a text editor such as Notepad. We recommend that you do not use a WYSIWYG editor like Frontpage or Dreamweaver for this purpose.
  4. Change the contents as necessary (options are described below).
  5. Save the file.
  6. Upload the file to your web site using the FTP application and overwrite the existing _2020applications_connection.asp file.
  7. The process is now complete. The new settings will be loaded the next time the web server's cache (Application Cache) is refreshed. You can refresh the application cache manually so that your changes are implemented immediately: visit the ?objApplication=RemoveAll section in _globals.asp.
  8. Note: At this point, if you have created a syntax error or have used invalid or inaccurate variables, you will see an error message on any/every page produced by 20/20 DataShed or you will be automatically directed to the "setup.asp" page. Fix the error, or undo your changes, or upload the original (working) copy immediately -- then refresh the application cache again.

Here is a list of all available variables:

booleanCacheConnectionString
True (Default) or False
booleanShowConnectionString
True or False (Default)
intDataProviderOption
  1. Microsoft .mdb Driver
  2. Microsoft.Jet.OLEDB Provider (Default)
  3. DSN
  4. Microsoft SQL Server Driver
  5. SQL OLEDB Provider
strDSNName
The name of a valid DSN. name. This variable is only used in conjunction with intDataProvider 3.
strDatabaseFileName
The name of the database (.mdb) file.
booleanUseAbsolutePath
True or False (Default)
Used only with intDataProviderOption 1 or 2.
strFolderLocation
A valid file path such as: c:\InetPub\wwwroot\data\
Used only with intDataProviderOption 1 or 2.
booleanUsePassword
True (Default) or False. This option must be True if the database is protected by an internal password.
Used only with intDataProviderOption 1, 2, or 3.
strSQLDataSource
Defines the name of the SQL Server usually by "Server Name"
Used only with intDataProviderOption 4 or 5.
strSQLAddress
Defines the address of the SQL server if running on a remote computer. Usually in the form of an IP address or domain name.
Used only with intDataProviderOption 4.
strSQLUid
Username to use to login to the SQL Server.
Used only with intDataProviderOption 4 or 5.
strSQLPwd
Password to use to login to the SQL Server.
Used only with intDataProviderOption 4 or 5.
strSQLNetworkLibrary
This setting defaults to the recommended "DBMSSOCN" network if the SQL Server resides on a remote computer and is discussed in depth in the Microsoft Knowledge Base article: Q238949.
Used only with intDataProviderOption 4 or 5.

These settings and variables are well documented within the source code.

Other Features

This file contains an additional feature which is documented here but is rarely of use to most customers except under special circumstances. In rare cases, it may be useful to connect 20/20 DataShed to multiple data sources. For example the MLS integration created and provided by Veara, Inc. makes use of this unique feature.

The list of variables (above) are stored in an array called arrConnectionProperties. At the bottom of the "_2020applications_connection.asp" is the following code:

dim arrConnectionProperties(0,13)
    arrConnectionProperties(0,0) = booleanCacheConnectionString
    arrConnectionProperties(0,1) = booleanShowConnectionString
    arrConnectionProperties(0,2) = intDataProviderOption
    arrConnectionProperties(0,3) = strDSNName
    arrConnectionProperties(0,4) = strDatabaseFileName
    arrConnectionProperties(0,5) = booleanUseAbsolutePath
    arrConnectionProperties(0,6) = strFolderLocation
    arrConnectionProperties(0,7) = booleanUsePassword
    arrConnectionProperties(0,8) = strSQLDataSource
    arrConnectionProperties(0,9) = strSQLAddress
    arrConnectionProperties(0,10) = strSQLUid
    arrConnectionProperties(0,11) = strSQLPwd
    arrConnectionProperties(0,12) = strSQLNetworkLibrary
    arrConnectionProperties(0,13) = "Local Database"

What is This?

The arrConnectionProperties variable stores a multi-dimensional array. The array contains one (1) row with thirteen (13) columns. Each "row" represents one (1) data source -- and the columns of that row store the information required to connect to that data source. In effect then, additional data sources can be defined by adding more rows. Each row becomes known within the software as a "Data Source" and each one has a "Data Source Index" (abbreviated within the software as a "DSI"). In other words, 20/20 DataShed can build connection strings (on-the-fly) to more than one database and the software can be connected (on-the-fly) to any of the available data sources. This can give the impression of having multiple databases operating with 20/20 DataShed simultaneously.

For example, if a second or third data source were available then the code might look like the following:

' the blue number below represents the number of rows in the array
' but remember that it's a zero-based array...so, zero is the first
' and the number 2 actually means there are three rows.

dim arrConnectionProperties(2,13)

    arrConnectionProperties(0,0) = booleanCacheConnectionString
    arrConnectionProperties(0,1) = booleanShowConnectionString
    arrConnectionProperties(0,2) = intDataProviderOption
    arrConnectionProperties(0,3) = strDSNName
    arrConnectionProperties(0,4) = strDatabaseFileName
    arrConnectionProperties(0,5) = booleanUseAbsolutePath
    arrConnectionProperties(0,6) = strFolderLocation
    arrConnectionProperties(0,7) = booleanUsePassword
    arrConnectionProperties(0,8) = strSQLDataSource
    arrConnectionProperties(0,9) = strSQLAddress
    arrConnectionProperties(0,10) = strSQLUid
    arrConnectionProperties(0,11) = strSQLPwd
    arrConnectionProperties(0,12) = strSQLNetworkLibrary
    arrConnectionProperties(0,13) = "Data Source #1"

    arrConnectionProperties(1,0) = True
    arrConnectionProperties(1,1) = False
    arrConnectionProperties(1,2) = 2
    arrConnectionProperties(1,3) = ""
    arrConnectionProperties(1,4) = "myOtherDatabase.mdb"
    arrConnectionProperties(1,5) = True
    arrConnectionProperties(1,6) = "C:\Inetpub\Databases\"
    arrConnectionProperties(1,7) = True
    arrConnectionProperties(1,8) = ""
    arrConnectionProperties(1,9) = ""
    arrConnectionProperties(1,10) = ""
    arrConnectionProperties(1,11) = ""
    arrConnectionProperties(1,12) = ""
    arrConnectionProperties(1,13) = "Data Source #2"

    arrConnectionProperties(2,0) = True
    arrConnectionProperties(2,1) = False
    arrConnectionProperties(2,2) = 5
    arrConnectionProperties(2,3) = ""
    arrConnectionProperties(2,4) = "myDatabase"
    arrConnectionProperties(2,5) = False
    arrConnectionProperties(2,6) = ""
    arrConnectionProperties(2,7) = False
    arrConnectionProperties(2,8) = mySQLServerName.com/mySQLInstance,1433
    arrConnectionProperties(2,9) = ""
    arrConnectionProperties(2,10) = "user_name"
    arrConnectionProperties(2,11) = "pass_word"
    arrConnectionProperties(2,12) = strSQLNetworkLibrary
    arrConnectionProperties(2,13) = "Data Source #3"

Some notes about the code above:

Warning

If you must access this file using another product or software, do so at your own risk; such activity is not supported by our license agreement and may void 20/20 Applications' technical support obligations.

Related topics


© 2005 - 2007 20/20 Applications. All rights reserved.