Stephen

This error means that it didn't recognize your field names, so you need to tell the 
driver about your datafile schema.

If you're using the Microsoft text driver, it gets schema information from a file 
called schema.ini in the directory that the datasource is pointing to. The required 
format of this is available from MSDN, but it's a lot easier to use the wizard in the 
ODBC Data Sources tool - go to System DSN, select the datasource, click "Configure", 
then "Options", and "Define Format". You can then associate fieldnames and formats 
with your text file

Hope That Helps

Alistair

Alistair Davidson
Applications Developer
www.smartgroups.com
Freeserve.com PLC

-----Original Message-----
From: Adams, Stephen [mailto:[EMAIL PROTECTED]] 
Sent: 24 July 2002 15:31
To: CF-Talk
Subject: Querying a CSV file

**********************************************************************
WESTMINSTER CITY COUNCIL
Please refer to the disclaimer beneath this message
**********************************************************************

I have a CSV file that I want to query.  In my CSV file I have added a row
with the column names in it, but when I try to query the file I getan error.
This is my query:

<cfquery name="getAirPollution" datasource="Pollution">
  SELECT  CGNOx,
                    CGNO
  FROM     Pollution.csv
  WHERE  Date = 20723
  AND       Time = 1245 
</cfquery>

And I get this error message.

ODBC Error Code = 07001 (Wrong number of parameters) 

[Microsoft][ODBC Text Driver] Too few parameters. Expected 2. 
Hint: The cause of this error is usually that your query contains a
reference to a field which does not exist. You should verify that the fields
included in your query exist and that you have specified their names
correctly.

Now this is the first time I have tried to use a csv file as a datasource,
the file is verified as a datasource in CF administrator,  but I am having
trouble writing the query.  Any help would be great, thanks.

Stephen


**********************************************************************
Westminster City Council switchboard: 
+44 20 7641 6000
**********************************************************************
This E-Mail may contain information which is 
privileged, confidential and protected from 
disclosure.  If you are not the intended recipient 
of this E-mail or any part of it, please telephone 
Westminster City Council immediately on receipt.
You should not disclose the contents to any other 
person or take copies.
**********************************************************************


______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to