In the ColdFusion Administrator, you configure your data sources to communicate with ColdFusion. Once you add a data source to the Administrator, you access it by name in any CFML tag that establishes database connections; for example, cfquery
. During a query, the data source tells ColdFusion which database to connect to and what parameters to use for the connection.
The ColdFusion Administrator organizes all the information about a ColdFusion MX server's database connections in a single, easy-to-manage location. In addition to adding new data sources, you can use the ColdFusion Administrator to correct for changes to your database, such as relocation, renaming, or changes in security permissions.
You use the ColdFusion Administrator to quickly add a data source for use in your ColdFusion applications. When you add a data source, you assign it a data source name (DSN) and set all information required to establish a connection.
Note: ColdFusion includes several data sources that are configured by default, including cfsnippets, CompanyInfo, and exampleapps. This procedure should not be necessary to work with these data sources.
A form for additional DSN information appears. The available fields in this form depend on the Driver that you selected.
Tip: The omission of required username and password information is a common reason why a data source fails to verify.
ColdFusion automatically verifies that it can connect to the data source.
Note: To check the status of all data sources available to ColdFusion, click Verify All Connections.
You can use the ColdFusion Administrator to specify connection string arguments for data sources that use the Microsoft Access,ODBC Socket, MYSQL, or DB2 drivers. In the Advanced Settings page for one of these drivers, enter name=value pairs separated by a semicolon in the Connection String field. The following figure shows how to specify the application name and workstation ID for an ODBC Socket connection to SQL Server:
The Administrator configures the following ODBC connection string:
DSN=odbcdsnname;APP=RaiseGenerator;WSID=TWriter01
In the preceding string, odbcdsnname
is the name of the ODBC DSN. This is the string that the Microsoft Access or ODBC Socket driver uses to connect to the data source at runtime.
Note: The connectstring
tag attribute is not supported in ColdFusion MX.
When adding data sources to ColdFusion MX, keep these guidelines in mind:
A data source must exist in the ColdFusion Administrator before you use it on an application page to retrieve data.