Home arrow ColdFusion arrow Page 3 - How to Access a SQL Anywhere Database with ColdFusion

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.

Author Info:
By: Jayaram Krishnaswamy
Rating: 5 stars5 stars5 stars5 stars5 stars / 17
April 10, 2006
  1. · How to Access a SQL Anywhere Database with ColdFusion
  2. · Create a Data Source, a DSN
  3. · Drivers in ColdFusion
  4. · Create and verify a test query in SQL Anywhere

print this article

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 DSN ColdAny created earlier.

Fig. 4
Database drivers

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.

Fig. 5

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.

Fig. 6

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.

Fig. 7

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

Fig. 8

blog comments powered by Disqus

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials