注册 登录
编程论坛 ASP技术论坛

excel导入数据的问题

chenlnpg 发布于 2010-01-20 15:15, 661 次点击
excel表如下所示
1     2  3  4
301   a  a  a
302   b  b  b
abc   c  c  c
303   d  d  d
为什么第一列的abc无法显示?
其它都正常



附:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

[Microsoft][ODBC Excel Driver]常见错误 不能打开注册表关键字 'Temporary (volatile) Jet DSN for process 0x954 Thread 0xc4c DBC 0x1c8b00c Excel'。
这个是什么原因?我在自己的机器上正常的代码,到服务器上测试变有这个错误了。。。

[ 本帖最后由 chenlnpg 于 2010-1-20 15:24 编辑 ]
3 回复
#2
aspic2010-01-20 16:15
DSN连接?
#3
yms1232010-01-20 18:31
你用什么方式打开的EXCEL?
代码怎么写的?
#4
chenlnpg2010-01-21 10:46
回复 3楼 yms123
是这样连接excel表的
Dim ExName
ExName = Request("ExName")
ExTName = Request.Form("ExTName")

Set conn011=Server.CreateObject("ADODB.Connection")
StrConn="Driver={Microsoft Excel Driver (*.xls)};DBQ="&ExName
conn011.Open StrConn

Set rs = Server.CreateObject("ADODB.Recordset")
Sql="select * from ["&ExTName&"$]"
rs.Open Sql,conn011,3,3



do while not rs.eof
for i=0 to rs.Fields.Count-1
if i mod rs.Fields.Count = 0 then
End if
rs.movenext
loop
大体意思如上所诉
1