LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Problem with query against CSV file using ADO

I'm using ADO withing Excel to connect to a CSV file.

My connection works:
'Where fpath is the folder where the csv file resides
cn.Open _
"Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
"Dbq=" & fpath & ";" & _
"Extensions=asc,csv,tab,txt"

This query works:

sql = "SELECT COUNT(F9) FROM filename.csv"

But when I add a WHERE clause:

sql = "SELECT COUNT(F9) FROM filename.csv WHERE F7 = 390"

I get the error "Too few parameters. Expected 1."

What can I do different to make this work?

tod
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Query Problem Robin G Excel Programming 1 August 28th 06 05:47 PM
VBA ADO SQL Query Problem gti_jobert[_81_] Excel Programming 8 April 6th 06 09:20 AM
Problem with MS Query - can't edit query jarems Excel Discussion (Misc queries) 2 December 12th 05 09:42 AM
Problem with .Background Query option of ODBC Query Shilps Excel Programming 0 April 19th 04 06:41 AM


All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"