T
todtown
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
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