Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I have no idea why I am getting this error
Message
From
28/07/2011 08:30:47
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
I have no idea why I am getting this error
Miscellaneous
Thread ID:
01519444
Message ID:
01519444
Views:
130
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?

TIA.
Next
Reply
Map
View

Click here to load this message in the networking platform