Following a brief explanation about the database drivers and the application environment in which the ColdFusion MX Server is installed, this tutorial describes a step-by-step method of creating a ColdFusion data source from the administrative panel of a ColdFusion MX 6.1 Server which derives its data from a MS SQL 2000 server. The tutorial then describes a ColdFusion application for running a database query against this data source.
Querying SQL 2000 Server from ColdFusion - Using ColdFusion data sources to connect to SQL Server 2000 (Page 2 of 4 )
When you log into the ColdFusion Administrator you can access the data related items by clicking on Data Sources under Data & Services in the navigational frame as shown. The Main frame shows all the connected data sources and provides an interface for adding a new data source as shown. There are four data sources that probably came with the installation that connect to MS Access database samples. If you now click on the Driver: drop-down arrow, you can see a variety of databases that you can query from ColdFusion applications as shown.
Since this tutorial is about connecting to a Microsoft SQL Server database, the appropriate choice is made as shown, and a name for the data source is chosen, CFSQL.
Now click on the Add button to add a new data source, which opens up the following screen. The view is shown with all the relevant information added. Here you give the data source a name, which you will later use in your query. You also specify the database, and the SQL 2000 server instance you will be connecting to, as well as the authentication information. You may also provide the authentication as a part of your query from your ColdFusion application. The name of the SQL Server is XPHTEK, and a short description of this source completes the configuration of the data source.
You can also see other possible advanced settings, and other choices you can make, by clicking on the Show Advanced Settings button which opens up the next screen. You have wide flexibility in using this data source by making appropriate choices.
For purposes of this tutorial, the default settings are used, and therefore you can now click on the Submit button. If the supplied information is acceptable, and authenticated, you will see that the data source you created is updated and appears in the list of connected data sources. You may also verify all the connections by clicking the Verify All Connections button. If the ODBC Agent has not started, then all the Microsoft Access related connections will show an error status, while it will not affect the SQL connection.
You have now created a data source which allows you to connect to the MS SQL Server's pubs database successfully.