我使用ado记录集连接excel文件很正常,语句如下:
With ADODATASET1 Do Begin
If Active Then Active := False;
ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;'
+ 'Data Source=D:\A.XLS;Extended Properties=Excel 8.0;'
+ 'Persist Security Info=False';
CommandType := cmdTableDirect;
CommandText := 'Sheet1$';
Active := True;
End;但是连接csv格式文件时就出错 ,提示“External Table Is Not In The Expected Format”,
各位大虾,如何解决?
On Line......
1.在ODBC中创建一个DSN
2.用adoconnection连接DSN就可以了!
用连接EXCEL的驱动接口连接可能不行!
如果用odbc,那采用哪种驱动?
Microsoft Text Driver(*.txt;*.csv)驱动即可!