+ -
当前位置:首页 → 问答吧 → asp 读取xls数据,加上where就出错,不知道为什么

asp 读取xls数据,加上where就出错,不知道为什么

时间:2011-11-09

来源:互联网

asp 读取xls数据,加上where就出错,不知道为什么

constr="Provider=Microsoft.Jet.OleDb.4.0;Persist Security Info=True;Data Source=" & strpath & ";Extended ProPerties=""Excel 8.0;HDR=YES;IMEX=1"";"
 
set xlsconn=server.createobject("adodb.connection")
xlsconn.connectionstring=constr
xlsconn.open() 

select * from ['4-20110811-4878$'] //这样就正常
select * from ['4-20110811-4878$'] where 电话号码='1' //这样就出错

xls有个列名 就是 “电话号码”

作者: shbaby008   发布时间: 2011-11-09

先看下你的xls里电话号码的字段属性是什么,不是数字型的你的条件写的就有错误

作者: yangmeihd   发布时间: 2011-11-09

excel 打开 电话字段 是 常规格式的

作者: shbaby008   发布时间: 2011-11-09