>Hi All
>
>I have code that looks like this to import a .csv file into a data reader:
>
>
>string query2 = "SELECT * from " + filename;
>string csvConString2 = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + processDirectory + ";Extensions=csv";
>OdbcConnection cn2 = new OdbcConnection(csvConString2);
>OdbcCommand stmtCmd2 = new OdbcCommand(query2, cn2);
>cn2.Open();
>OdbcDataReader rdr = stmtCmd2.ExecuteReader();
>
>
>query2 contains the following:
>
>SELECT * from \\hcsfile\company\Applications\Brightree\NightlyDataDownload\ManualProcessingFolder\Recommended_For_Collection_Emphasis_07-28-11.csv
>
>I get the following error on the ExecuteReader method:
>
>ERROR [42000] [Microsoft][ODBC Text Driver] Syntax error in FROM clause.
>
>Now, the goofy thing is that the same code works flawlessly in other places. (No - this is not my code! I would have done this using SSIS.) So what gives here?
One obvious question : what is the content of 'filename' ?