The process for adding a data source in the ColdFusion Administrator is the same, whether you use an ODBC, OLE DB, or native driver. The following procedure adds an ODBC data source that uses a SQL Server driver.
The Data Sources page displays any Data Source Names (DSNs) of that type that are available to ColdFusion:
Note Do not name a ColdFusion data source Registry or Cookie, as these words are reserved for use by ColdFusion. |
The Create Data Source page displays:
The information that you enter on this page depends on the platform on which you installed ColdFusion and on the driver you specify. For detailed information about options for your driver, see the section for your specific database.
Note For the Server field, if you are connecting to a local SQL Server database using the Microsoft SQL Server driver, enclose the word local in parentheses: (local). |
For detailed information about these settings, see "ColdFusion Settings" on page 120.
ColdFusion automatically verifies that it can connect to the data source.
If ColdFusion cannot verify the data source, the Status displays as Failed. You can run a cfquery
against the failed data source to get more detailed information about the problem. You also can try embedding a username and password into the cfquery
tag to see if the query works.
Note You might need to supply a username and password for the data sources that you want to verify. To define a username and password for a data source, edit the properties for the data source. |
If you are creating a UNIX data source, you might need to set environment variables for your database client library by editing the ColdFusion start script in <installdir>/coldfusion/bin. For detailed information about editing the ColdFusion start script for your particular database, see Advanced ColdFusion Server Administration.
To define a number of advanced ODBC and ColdFusion settings in the ColdFusion Administrator, select a data source and click the CF Settings button. These settings apply to all platforms. The following table describes the ColdFusion data source settings: