Vivekh
Vivekh

Reputation: 4259

Error on delimited

have problem with delimited on one PC but on mine is everything good. I have WinXP but my friend Vista.

Here is the code:

string AccessKonekcija2 = null;
AccessKonekcija2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\exports_blaise2\\" + textBox22.Text + ".mdb";
 System.Data.OleDb.OleDbConnection AccessExcelKonekcija = new System.Data.OleDb.OleDbConnection(AccessKonekcija2); 
System.Data.OleDb.OleDbCommand AccessExcelKomanda = new System.Data.OleDb.OleDbCommand(); 
AccessExcelKomanda.Connection = AccessExcelKonekcija;
 AccessExcelKomanda.CommandText = "SELECT * INTO[Text;HDR=Yes;FMT=Delimited;DATABASE=C:\\exports_blaise2\\zips\\manipulai\\" + value3 + "\\" + textBox22.Text + "\\OUT].[" + value3 + "man.txt] FROM " + value3 + "man";    
AccessExcelKonekcija.Open(); AccessExcelKomanda.ExecuteNonQuery();     
AccessExcelKonekcija.Close();

And the error is: enter image description here

Can someone tell me whats wrong ? And how come that I can do that w/o an error. But my friend not.

I already checked regional setting they are both equal.

Upvotes: 0

Views: 350

Answers (1)

Daren Thomas
Daren Thomas

Reputation: 70344

Check the Regional Settings in Control Panel: One of the things you can set is the list separation character. The error message sounds like this could be the case. Since Excel respects this setting for CSV files and your code mentions Excel somewhat... give it a try?

Make sure they match. Standard (US) is ,. Here in Switzerland, though, it is normally ; and this can lead to subtle errors like the one you're having...

Upvotes: 1

Related Questions