Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Chili!Soft ASP and Databases

bullet Introduction
The Chili!Soft ASP engine is designed to make connecting to a database easy to do. You can connect to a remote database, or to a MySQL database running on your Virtual Private Servers. There are two basic methods for connecting to a database. The first uses a DSN (Data Source Name) stored on your Virtual Private Servers which contains the connection information. DSNs are potentially insecure because the user and password to access the database is stored in a file on the server that can be accessed by others, if they know where to look. For more secure connections, you can use a DSN-less connection. This stores the database connection information in the ASP source document, which can not be viewed or used by others.


bullet Creating a DSN
Chili!Soft stores its DSN information in the ~/usr/local/casp/asp-apache-3000/ directory, in a file called odbc.ini. This file contains templates which it uses when creating DSN-less connections, and is where your DSNs would be put. An example of a DSN for a local MySQL database might look like this:

The DSN name, enclosed in square brackets, should be the same as the name of the database you are accessing. If you are connecting to a remote database, you would replace the value localhost in the Server= line with the name of the server where the database is (or the TNS name for Oracle).

Once you have created your DSN and saved it in the odbc.ini file, you can then access the database by creating a Connection String in your ASP code. You can also create a FileDSN, which contains a DSN stored in a file other than the odbc.ini file.

The connection string for a DSN connection would look similar to either of these:

connect_string = "dsn=[mydatabase]"


If you want to create a DSN-less connection, you would need to include the same connection information from the DSN in the Connection String. A DSN-less connection string might look like the following:

connect_string = "Driver={Mysql}; Server=localhost; Database=mydatabase; UID=myuser; PWD=Shh!-dont_tell!"


bullet More Information
See the Chili!Soft ASP Documentation, chapter 4, in the section "Connecting to a Database" for more information on using databases with your ASP applications.

Toll Free 1-866-GSP-4400 • 1-301-464-9363 •
Copyright © 1994-2016 GSP Services, Inc.