ASP连接数据表(ACCESS)

2024-12-29 14:55:57
推荐回答(2个)
回答1:

<%
dim ConnString
set conn=server.CreateObject("adodb.connection")
ConnString="provider=microsoft.jet.oledb.4.0;data source=" & server.MapPath("*.mdb")
conn.open ConnString
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from tb_info",conn,1,3
if rs.bof and rs.eof then
response.write ""
response.end
else
do while not rs.eof
%>

<%=rs("info_admin")%>

<%
rs.movenext
loop
rs.close
%>

回答2:

use *.mdb
select info_admin from tb_info