急~ 求助 asp 对象关闭时,不允许操作。
<%dimstrsql,DBPath,connstrdbpath="data/cbc.mdb"connstr="provider=Microsoft.jet.oledb....
<% dim strsql,DBPath,connstr
dbpath ="data/cbc.mdb"
connstr= "provider=Microsoft.jet.oledb.4.0;Data Source ="&server.mappath("dbpath")
set rs = server.createObject("ADODB.Connection")
strsql="select ProductName from Products"
rs.open strsql,connstr,1,2
do while not rs.eof
response.write rs("productName")
response.write"<br>"
rs.movenext
loop
%>
就是这段代码运行的时候出现对象关闭,不允许操作怎么回事? 展开
dbpath ="data/cbc.mdb"
connstr= "provider=Microsoft.jet.oledb.4.0;Data Source ="&server.mappath("dbpath")
set rs = server.createObject("ADODB.Connection")
strsql="select ProductName from Products"
rs.open strsql,connstr,1,2
do while not rs.eof
response.write rs("productName")
response.write"<br>"
rs.movenext
loop
%>
就是这段代码运行的时候出现对象关闭,不允许操作怎么回事? 展开
1个回答
展开全部
<% dim strsql,DBPath,connstr
dbpath ="data/cbc.mdb"
connstr= "provider=Microsoft.jet.oledb.4.0;Data Source ="&server.mappath("dbpath")
set conn.= server.createObject("ADODB.Connection")
conn.open connstr
strsql="select ProductName from Products"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open strsql,conn,1,1
do while not rs.eof
response.write rs("productName")
response.write"<br>"
rs.movenext
loop
%>
dbpath ="data/cbc.mdb"
connstr= "provider=Microsoft.jet.oledb.4.0;Data Source ="&server.mappath("dbpath")
set conn.= server.createObject("ADODB.Connection")
conn.open connstr
strsql="select ProductName from Products"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open strsql,conn,1,1
do while not rs.eof
response.write rs("productName")
response.write"<br>"
rs.movenext
loop
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询