excel 导入到SqlServer又有新问题 急! 没分了,有没有好心人?
Miudy 2006-02-10 03:50:07 test. xls 导入 数据库表 table1
table1 中的含有列 A B C D 而test.xls 中只有A和B 也就是说 test.xls中的数据 是表table1 的一部分
....
'代码
cn.Execute "insert into table1 select A , B from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;HDR=Yes;database=c:\test.xls;','select A,B from [sheet1$]')"
.....
总是出现 插入错误:列名或所提供值的数目与表定义不匹配.
为什么? 难道不能这样实现把Excel中的数据 插入到数据库表的某些列中吗??
各位 求救!!!!!