This is how we've been doing it:

<cfset ConnectString = "Driver={Microsoft Text Driver (*.txt;
*.csv)};Dbq=#fulldirectorypath#;Extensions=txt,csv;Persist Security
Info=False;">

<CFQUERY NAME="Log" DBType="dynamic" ConnectString="#ConnectString#">
        SELECT  *
        FROM            [#file#]
        ORDER BY        myColumn
</CFQUERY>

fulldirectorypath is the directory not the file. file is the filename
excluding the extension.

Matthew Walker
http://www.matthewwalker.net.nz/




> -----Original Message-----
> From: Michael Kear [mailto:mkear@;afpwebworks.com]
> Sent: Tuesday, 29 October 2002 4:22 p.m.
> To: CF-Talk
> Subject: DSN-less connection to a CSV file?
> 
> 
> I have an information provider FTP'ing a series of .csv files 
> into my server
> every night, and I need to use these files to create dynamic 
> tables for
> users.   Since they are updated every day, I can't have them 
> locked and in
> use when the provider's automatic ftp dumps them into my site.
> 
> So what I wanted to do was set my calculator up so that when 
> my site user
> calls the information, the page connects to the .csv table, 
> does the query
> then disconnects again.
> 
> Is this (a) possible?  (b) the best way to access (only read 
> - not write or
> update) the .csv files so that they are not locked when the 
> ftp program
> comes to drop new ones on the server?   If so, can someone 
> please give me
> the code to connect to the .csv file?
> 
> (we're using CF5)   There's no documentation at all about 
> dsnless connection
> in the docs, and I haven't been able to find any thing in the 
>  archives of
> this list or any other.
> 
> 
> Cheers,
> Mike Kear
> Windsor, NSW, Australia
> AFP WebWorks
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to