Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems Querying Text File Datasource Using ODBC/Coldfusion MX

Status
Not open for further replies.

cfdeveloper

Programmer
Nov 20, 2003
144
0
0
GB
Hi,

Just wondering if anyone has experience with using the Microsoft Text ODBC Driver with Coldfusion?

The problem I am getting is that the datasource I have to work with is named "account.dat.cgi".

I have set up a System DSN on the server for the folder containing this file, and configured it so that the ODBC manager finds all the columns and have set all the datatypes. All looks fine. I should note that when I originally did this I got an error, as detailed in this MS Support article:


I took the third option they detail, namely to add both "dat" and "cgi" to the registry entry - and this cured the problem.

Next I added the ODBC DSN into the ColdFusion datasources.

However, when I wrote a short CF script to query this datasource, I got the below error:


Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Text Driver] The Microsoft Jet database engine could not find the object 'account.dat.cgi'. Make sure the object exists and that you spell its name and the path name correctly.

The error occurred in E:\inetpub\ line 21

19 : <cfquery name="getAccount" datasource="articleManager">
20 : select * from account.dat.cgi
21 : where LCASE(USERLOGINID) = '<cfoutput>#LCASE(session.user.username)#</cfoutput>'
22 : </cfquery>



The first thing I suspected was that ColdFusion hasn't allowed me to query the .dat or .cgi file types despite the setup in the ODBC. To that end I made a duplicate of "account.dat.cgi" and renamed it "account.txt". After updating my script to query the new file, everything worked fine.

So, does anyone know of a way I can get ColdFusion to query the original file? Or perhaps a different method entirely? The file is used for the user account data for an application we use, and the application does not allow very good user account management, so I've been asked to write a couple of ColdFusion scripts that will allow users to create/modify/delete new accounts?

Regards,

cfcoder
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top