How to Access a SQL Anywhere Database with ColdFusion
In this article, you will learn about connecting from the ColdFusion MX 6.1 Server to a SQL Anywhere 9 database. This technique can be useful in a variety of applications, for example when a traveling salesman keeps some data from a database on a PDA or a laptop computer and periodically reconnects to the main database for updates.
How to Access a SQL Anywhere Database with ColdFusion - Drivers in ColdFusion (Page 3 of 4 )
ColdFusion MX 6.1 supports a variety of drivers to connect to databases. Quite a few drivers are available, and with the ODBC driver it is possible to connect to databases not in the list. Fig.4 shows the drivers available for connection. Although a driver for Sybase is shown, an ODBC Socket connection will be used in this tutorial as it is much easier to configure. We will be using the ODBC System DSNColdAny created earlier.
Configure a ColdFusion Data Source
To configure the ColdFusion data source you need to log in to the Administrative Panel of ColdFusion MX 6.1. On the left-hand navigational frame click on Data Sources under Data and Services to kick up the Data Sources page on the right-hand side as in Fig.5. It will be assumed that you have started the server (if not, you will go to Services in the Control Panel and start the ColdFusion related service, ColdFusion ODBC Server). Again it is recommended that you read up on the previous tutorials. It is in this frame that you will create the data source. In the upper form with the title Add New Data Source you enter the ODBC data source name you created earlier - ColdAny. For the driver you use the pull down menu to pick up ODBC Socket and click on Add.
This brings up the screen shown in Fig.6 where you need to add the authentication information. Since the DSN was created by the computer administrator, a trusted connection is used. The system is the username. You do not need a password.
In addition to the above you will be able to show additional default settings as shown in Fig.7 by clicking on the Show Advanced Settings button. If needed you may make the choices here appropriately. In this tutorial the defaults are taken. You can even grant and revoke privileges and use all the DDL and DML commands.
When you are finally satisfied with your choices you may hit the Submit button, which will take you to the screen shown in Fig.8. The screen shows that you successfully created a ColdFusion usable source to interact with the data on the SQL Anywhere backend database, mysorian.db. If you come back to this screen at a later stage it will be necessary to make sure that the connection status is OK by hitting the Verify All Connections button shown in Fig.8