strConnection = _T("Driver={Microsoft Text Driver (*.txt; *.csv)};"
"Dbq=C:\\DatabasePath\\;Extensions=asc,csv,tab,txt;");
If you are using tab delimited files, you must to create the schema.ini file, and you must to inform the Format=TabDelimited option in your connection string
Note: You must to specify the filename in the sql statement....
For Example:
CString strQuery = _T("Select Name, Address From Clients.csv");
Connecting to a Text File using the JET OLE DB Provider: strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\DatabasePath\\;"
"Extended Properties=\"\"text;"
"HDR=Yes;FMT=Delimited;\"\";");
Note: You must to specify the filename in the sql statement....
For Example:
CString strQuery = _T("Select Name, Address From Clients.txt");
see
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q262537