image\cslogo3d1.gif

Syntax for DSN-less Connection Strings

The following table lists the parameters to define and the syntax to use for each type of database in DSN-less connection strings.

Database Type

Syntax for DSN-less Connection Strings

DB2

DSN-less connection strings are not supported for DB2 databases. You must use system DSNs.

dBase 5

connect_string = "Driver={Dbase}; DBQ=[pathname]; defaultDir=[default_directory]"

where [pathname] is the absolute path name of the directory containing the database file and [default_directory] is the default directory for the database.

Informix 7, 9

connect_string = "Driver={Informix}; 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.

Microsoft Access

DSN-less connection strings and file DSNs are not supported for Microsoft Access databases. You must use system DSNs.

Microsoft SQL Server 6.5

DSN-less connection strings and file DSNs are not supported for Microsoft SQL Server 6.5 databases. You must use system DSNs.

Microsoft SQL Server 7.0

connect_string = "Driver={SQL Server}; Database=[database_name]; UID=[username]; PWD=[password]"

where [database_name] is the name of the database, and where [username] and [password] are the username and password required for accessing the database. Note that 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."

MySQL

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.

Oracle 7

connect_string = " Driver={Oracle7}; Server=[TNS_name]; UID=[username]; PWD=[password]"

where [TNS_name] is the TNS name as defined in the tnsnames.ora file, and [username] and [password] are the username and password required for accessing the database.

Oracle 8, 8i

connect_string = " Driver={Oracle8}; Server=[TNS_name]; UID=[username]; PWD=[password]"

where [TNS_name] is the TNS name as defined in the tnsnames.ora file, and [username] and [password] are the username and password required for accessing the database.

PostgreSQL

connect_string = " Driver={Postgres}; Server=[server_name] UID=[username]; PWD=[password]"

where [server_name] is the name of the database server, [username] and [password] are the username and password required for accessing the database.

Sybase 11

connect_string = " Driver={Sybase}; 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.

See also:

Using DSN-less Connection Strings in this chapter

Copyright 2001 Sun Microsystems, Inc. All rights reserved. Legal Notice.