> I've been trying to figure out why Macromedia discontinued
> providing a text driver with ColdFusion after version 5. All
> the documentation pointed towards accessing textfile
> databases in a different way, perhaps using the CFHTTP or
> CFFILE tag. But it's foggy at best, or at least what
> documentation I have found is unclear. I have tried setting
> up some 3rd party JDBC textfile drivers, but they are
> incredibly unstable and very slow.
> Unfortunately I dont control the text files, otherwise they
> would be in an oracle database, but also I need to access the
> information in these files in a timely manner. In some cases
> the information will have to be accessed and dynamically
> posted to a webpage. Does anyone have any suggestions for a
> reliable textfile driver or info on how one can query the
> info in a textfile database?
I think you answered your own question - the JDBC textfile drivers you tried
are incredibly unstable and very slow, thus CF doesn't include them. But in
any case, it's easy to use either CFHTTP or CFFILE to read text files, and
especially CFHTTP which has a whole set of attributes just for this purpose.
Let's say you have a text file like this:
"ID","FIRST_NAME","LAST_NAME"
"1","Joe","Smith"
"2","John","Doe"
You can point to it with CFHTTP (assuming it's in a web-accessible directory
somewhere) like so:
<cfhttp url="..."
method="get"
name="qPeople"
firstrowasheaders="yes"
delimiter=","
textqualifier="""""">
The TEXTQUALIFIER attribute is a bit funny in this case, since it's supposed
to represent the characters at the beginning and end of each value, which
are double quotes in the sample file. To include double quotes within a
double-quoted string in CF, you escape them by doubling them.
If your file was tab-delimited instead, you could just specify
DELIMITER="#Chr(9)#".
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203758
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54