ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 27th, 2005, 04:36 PM
netbryan netbryan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Location: Denver, Colorado
Posts: 1 netbryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 23 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old June 27th, 2005, 06:04 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
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.
Comments on this post
MatthewClark agrees!
__________________
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Text File as Data Source


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT