When I read a CSV file in OLE DB today, we found that the resulting text was not usually separated by commas. Instead, tab tabs are used to separate them.
OrderID OrderName1 3
And then went to msnd to query the existing specified Parameters for tab tab:
tabdelimited files are used as tab-delimited files
Then try to drop the FMT set to tabdelimited, but the results are found and cannot be separated as a result. It seems that Microsoft's document pits or their own understanding may be biased. See the FMT with other parameters, and then try each one:
Fmt=1 ==> failed fmt=delimited ("+" "+") ==> failed
And then see on the Internet that you can change the registry, because the default value of the comma is set in the registration table, this is the path:
Hkey_local_machine\software\microsoft\jet\4.0\engines\text\format
But I couldn't find it. Because the system is win8 possible location is not the same pit dad ... Google also can't get on ... So the way to change the registry has not been tried. And it is not recommended to change the registry.
Serach on the internet for half a day, and finally found a more magical solution for me, the use of schema.ini files.
Create a file in the same directory as the CSV file, and then write the content:
[Order.csv] format=tabdelimitedcolnameheader=truemaxscanrows=0col1=orderid text Width tencol2=ordername text Width
Run the program and get the expected results:
OLE DB reads a CSV file: using the specified separator symbol