Just a quick note back to Charlie: Thanks again for the good advice. Although I never messed with cfhttp getting it to work with .csv, I was able to use the information you sent me on configuring DSN for text files and my app is now working great with it. Also thanks again for providing a good resource like cf411.
Kind regards, Dusty On Thu, Mar 12, 2009 at 5:19 PM, Dusty Hale <[email protected]> wrote: > Another reason I like this approach better: > > Using the cfquery tag as oppose to cfhttp allows me to use the > "cachedwithin" attribute and since it is the same results all the time, it > will be less overhead (again I assume). > > Dusty > > > On Thu, Mar 12, 2009 at 5:15 PM, Dusty Hale <[email protected]> wrote: > >> Sweet thanks for the reminder about that. I set up a DSN and CF datasource >> for the text files and works great. I personally like this approach better >> than the cfhttp tag because I think it will be easier to keep the files >> outside of the webroot. Also it solves the .csv problem at the same time (i >> think :-) >> >> Thanks again for your very good advice and help. >> >> Dusty >> >> >> >> On Thu, Mar 12, 2009 at 2:55 PM, Charlie Arehart <[email protected]>wrote: >> >>> Well, Dusty, the blog entry I’d pointed to (in a note on Monday) was >>> from 2002. It uses a feature (from CF5, no longer available) to do DSN-less >>> connections, thus the connectstring. >>> >>> >>> >>> Instead, use the more recent entry by Mark Kruger, which I pointed to >>> below in a more recent note. >>> >>> >>> >>> Also, what about the more significant point I was making: that your >>> attempt to use CFHTTP with a csv file failed (when a txt worked) because of >>> a likely web server problem? >>> >>> >>> >>> PS Thanks, Shane, for your thoughts on the other thread. >>> >>> >>> >>> /charlie >>> >>> >>> >>> *From:* [email protected] [mailto:[email protected]] *On Behalf Of *Dusty >>> Hale >>> *Sent:* Thursday, March 12, 2009 8:56 AM >>> *To:* [email protected] >>> *Subject:* Re: re[2]: [ACFUG Discuss] excel or csv to database table >>> >>> >>> >>> Hi Charlie and many thanks for the good advice. I got curious about >>> running real queries on text files. I have done this some years ago using a >>> DSN. I looked over your blog post on the zip code data. When I try to use >>> this approach though I get the following error that the attribute >>> "connectstring" does not exist for the cfquery tag (strange). >>> >>> >>> >>> The tag does not have an attribute called connectstring. >>> >>> The valid attribute(s) are name, datasource, dbtype, sql, username, >>> password, maxrows, blockfactor, timeout, >>> >>> dbname, cachedafter, cachedwithin, result, debug. >>> >>> >>> >>> >>> >>> On Mon, Mar 9, 2009 at 6:54 PM, Charlie Arehart <[email protected]> >>> wrote: >>> >>> Dusty, I wonder if your problem isn’t a CF one, but a web server one. I’d >>> bet when you try to retrieve the file as a CSV, the web server steps in and >>> changes the mime type to something other than plain text, and therefore CF >>> (and the CFHTTP) gets something other than what they expected. >>> >>> >>> >>> (BTW, that code you show below doesn’t come from my site, per se, but >>> maybe you got it from a link off of it). >>> >>> >>> >>> I just ran a test of some working code (adapted from an example Ben Nadel >>> put together). It works fine for me, whether file is called .txt or .csv. >>> I’ve attached the files here. Do they work for you (may need to adjust the >>> url in the cfm page)? If not, then I’d think the web server is your issue. >>> >>> >>> >>> (You could also request the CSV in your browser, or—to remove browser >>> processing from the analysis--do your CFHTTP without the NAME attribute, >>> which then just reads it as a text file. Dump the entire CFHTTP scope, to >>> see the cfhttp.mimetype. >>> >>> >>> >>> Anyway, here’s a simpler way to read in a CSV as a database (one I do >>> link to from my CF411 site, and which would be easier than the older >>> approach I mentioned in my last note), which doesn’t rely on CFHTTP or then >>> get bothered by any web server mapping issues: >>> >>> >>> >>> http://www.coldfusionmuse.com/index.cfm/2007/2/5/csv >>> >>> >>> >>> Hope that’s helpful. >>> >>> >>> >>> /charlie >>> >>> ------------------------------------------------------------- >>> To unsubscribe from this list, manage your profile @ >>> http://www.acfug.org?fa=login.edituserform >>> >>> For more info, see http://www.acfug.org/mailinglists >>> Archive @ http://www.mail-archive.com/discussion%40acfug.org/ >>> List hosted by FusionLink <http://www.fusionlink.com> >>> ------------------------------------------------------------- >>> >> >>
