我在这里有一个案例,我使用与ADO连接的excel文件,excel 2003文件似乎没问题,但是当我使用excel 2007或更新版本时,我收到记录数量时出现了一些问题..
我的连接字符串对于excel 2003来说是这样的:
format('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;Extended Properties=Excel 8.0;',[filename])
和excel 2007或更新版本(xlsx文件)的相同连接字符串
format('Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%s;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=1"',[filename])
我还需要更多东西吗?或者我错过了什么才能被允许使用recordcount,recno等等?
答案 0 :(得分:3)
看看这篇文章: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=33
基本上,您需要将CursorType
设置为ctOpenForwardOnly
以外的其他内容。