Connecting to a Database in Cold Fusion MX - Troubleshooting Errors
Windows 98/ME
If the server is running on a Windows 98 or ME machine, connecting to a database in Cold Fusion MX is done through an ODBC-JDBC bridge First create a system DSN in Start>Control Panel>ODBC Data Sources>System DSN and then connect to this using Cold Fusion Administrator using a JDBC-ODBC Bridge to connect to a data source. I have not encountered any problems in connecting to an Access database in this fashion although Macromedia advises that performance of such a Type 1 driver will be inferior to other drivers.
Windows 2000/XP
If the server is running under Windows 2000 or XP, one can connect to the database entirely through Cold Fusion Administrator. When connecting to the database in CF Admin, one may get the following error:
"java.sql.SQLException: SQLException occured in JDBC Pool while attempting to connect, please check your username, password, URL and other connectivity information ..."
This error has been the subject of numerous postings on the Cold Fusion forum at www.macromedia.com primarily in the "Database Access" section of the forum Here are some suggestions for eliminating this error when connecting to an Access database. These will also have some relevance to connection problems for other databases:
- Submit the database a second time - this seems to eliminate the problem in the CT228 classroom
- In Control Panel>Administrative Tools>Services, make sure that your ODBC Agent and ODBC Server Services are started. If they aren't, and you get an error message when trying to start them, go to Control Panel>Computer Something>Event Viewer>Application. Double-click on the line(s) for Cold Fusion. If you see a 430 error ("unable to open event trace file"), go to C:\CFusionMX\db\slserver54\tracing directory and see if you have files with the .trc extension. If so, delete those and then try starting the ODBC services again. (Source: Debbie Dickerson, Tech Support, Macromedia, August 1, 2002 post to "Unable to start MX ODBC Agent or Server Services" thread).
- Install a patch to the Microsoft Virtual Machine (VM) which partially involves Java Database Connectivity (JDBC) classes. This patch is described and available through Microsoft Knowledge Base Article Q329077
- If the Access database requires no security (no username or password required for access) which is the default, then in CF Admin ensure that the "Default Username option" is selected. If the Access database uses security, the necessary procedures in CF Admin are described in Macromedia TechNote 23381 created September 13, 2002.
- Download a recent version of the Microsoft Data Access Components (MDAC) (minimum 2.6SP2 recommended). To determine what MDAC version you currently have, you can download a free Component Checker from Microsoft.
- Download Jet4.0SP3 from Microsoft.
- Make sure that CFAdmin is running under an account that has administrator privileges and read/write access to the folder containing the Access database.
Macromedia is currently working on a technote to address these issues. In addition, one should ensure that one is running the latest version of Cold Fusion MX by downloading and installing the Cold Fusion MX Updater (14.5 MB for Windows)
Error message: Element SQLExecutive is undefined in Request
Solution: Go to CFusionMX/lib directory. The neo.query-xml file may be missing or corrupt. If present, delete it. Then make a copy of the neo.query.bak file and name it neo.query-xml. Restart your CF services. You should now be able to access the datasource link in CF Admin. (Source: Stephanie Juma, Cold Fusion Technical Support, Macromedia, August 19, 2002 post to thread for this error message under Cold Fusion Server Administration)
Revised: October 9, 2002. Comments to William Pegram, wpegram@nvcc.edu