|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Text File as Data Source
I want to use a text file as a data source to dynamically populate a drop-down selection menu. I had my admin set up a DSN for the tab delimited text file. Everything looks correct, but we're getting the following error:
--- Error Executing Database Query. Data source not found. --- Here is the query code: --- <cfquery name="q_customername" datasource="active_customers"> SELECT * FROM active_customers.txt ORDER BY otc_txt_customername ASC</cfquery> --- I've tried everything I can think of to get this to work, but it's just not happening. The customer list changes frequently and the text file is set to refresh regularly, so it would be nice to query the text file directly and ensure a constantly updated selection menu. Any insight to what might be wrong would be greatly appreciated. Thanks! Footnote 1: I tried a workaround with an Access db -- imported the text file as a linked table, created a query within the db, then hit that query with a CFQUERY. It worked for a little while, then inexplicably started throwing the "link specification does not exist" error. So, so much for that option. Footnote 2: I've also been pushing around the CFHTTP method to query the text file, but I can't figure out how to get the CFHTTP query to *pass* the selection to a second page. I need to auto-populate a form with the selected customer name and other fields of info directly related to the selected customer (address, etc.). Last edited by netbryan : June 27th, 2005 at 04:44 PM. Reason: Additional helpful info |
|
#2
|
|||
|
|||
|
Don't do this...using a text file as a data source is just a bad idea. If you really have to, read in the whole data set using cffile, cache it in the application scope, and then use query of queries on that cached result set to get individual elements. It will be way faster.
The best solution is really to import this data into a real database.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Text File as Data Source |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|