Microsoft Jet 数据库引擎打不开文件''。 它已经被别的用户以独占方式打开,或没有查看数据的权限。
Dim objConn,objRS
Dim strConn,strSql
dim lRecCount
set objConn=CreateObject("ADODB.Connection")
set objRS=CreateObject("ADODB.Recordset")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 4.0;Data Source=navis_vq.xls"
'strConn="Driver={Microsoft Excel Driver (*.xlsx)};DBQ="&Server.MapPath("navis_vq.xlsx")
objConn.Open strConn
strSql="SELECT * FROM [newSheet]"
objRS.Open strSql,objConn,1,3
ordera=0
response.Write ordera
objRS.MoveFirst
while not objRS.eof
ordera=ordera+1
html=html& "<tr>"&_
"<td width=""200"" height=""30"" style=""border-bottom:1px solid #ccc;border-right:1px solid #ccc""> "&(objRS(0)) & "</td>"&_
"<td width=""200"" style=""border-bottom:1px solid #ccc""> " & (objRS(1)) & "</td>"&_
"</tr>"
'"<td width=""80"" height=""30"" style=""border-bottom:1px solid #ccc;border-right:1px solid #ccc""> "&ordera & "</td>"&_
objRS.MoveNext
wend
response.Write "<table style=""border:1px solid #ccc;border-bottom:0;margin:50px auto auto 100px"" cellpadding=""0"" cellspacing=""0"">"&html&"</table>"
objRS.Close
objConn.Close
set objRS = Nothing
set objConn = Nothing
求大神指导。。困扰已久。。。