As discussed in "Creating Connection Strings" in this section, using a DSN-less connection string is one way to specify the information—in the form of parameters and their values—needed for establishing a database connection. Unlike system DSN and file DSNs, which incorporate this information by reference, DSN-less connection strings include all of the required database parameters.
You use the following syntax for a connection string:
connect_string = "[parameter_1=value_1; parameter_2=value_2; parameter_3=value_3]"
where [parameter_1=value1; parameter_2=value_2; parameter_3=value_3] specifies the required parameters for the given database.
The following example shows a DSN-less connection string for a MySQL database:
connect_string = "Driver={Mysql}; Server=[server_name]; Database=[database_name]; UID=[username]; PWD=[password]"
where [server_name] is the name of the database server, [database_name] is the name of the database, and [username] and [password] are the username and password required for accessing the database.
Different types of databases can require that you specify different parameters. The parameters to configure for each database in a DSN-less connection string are provided in "Syntax for DSN-less Connection Strings" in this section.
Note about using Windows connection strings with Chili!Soft ASP for Linux or UNIX
Connection strings must be constructed according to the requirements of the ODBC driver being used. Chili!Soft ASP for Windows NT uses standard Windows ODBC drivers, so connection strings you developed for Windows will work. However, the ODBC drivers for Linux and UNIX platforms are different than for Windows, so before you can use Windows connection strings with Chili!Soft ASP for Linux or UNIX, you must edit them to use the syntax described in this section.
Note about supported databases
- With Chili!Soft ASP for Linux or UNIX, you cannot use DSN-less connection strings or file DSNs for connecting to DB2, Interbase, Microsoft Access, or Microsoft SQL Server 6.5 databases; you must use system DSNs for connecting to these databases.
- With Chili!Soft ASP for Linux or UNIX, before you can reference a Microsoft SQL Server 7.0 database in a DSN-less connection string or a file DSN, your system administrator must take the steps described in "Editing the Microsoft SQL Server Template" in "Chapter 3: Managing Chili!Soft ASP."
- Chili!Soft ASP 3.6 installs the ODBC drivers for a number of databases, but it does not support all databases on all platforms. You can view the list of installed drivers in the Installation Requirements topic for your platform in the "Installing and Uninstalling Chili!Soft ASP" section of "Chapter 2: Installing and Configuring Chili!Soft ASP."
See also:
Connecting to a Database in this chapter
Creating Connection Stringsin this chapter
Copyright 2001 Sun Microsystems, Inc. All rights reserved. Legal Notice.