To connect to the database from script you should use the connection string included into the global.asa/global.asax file for ASP/.NET application, or directly into the script itself.

The connection string contains the information about the database. It may use the exisintg Data Source Name (DSN) which already has database location details and driver specified. Or, you will need to specify the database location and driver to be used in the connection string directly.

Below are the links to examples for different types of connection strings, and to sampe scripts you can use to test the connection between application and database.

 ASP 

 

These examples may not work for you without certain modifications. The purpose of the examples is to give you a general idea on the topic. Please refer to Microsoft Visual InterDev documentation for more information on global.asa and other aspects of database connectivity.

 .NET

You will need to use application settings from global.asax in your ASPx file that manipulates the database:

Here is the example on how to access the databases using ASP.NET without setting up global.asax: