<
%
‘
示例:ASP连接Access数据库,无密码连接
DBPath
=
Server.MapPath(
“
myData.mdb
“
)
‘
数据库存放路径
Strconn
=
“
DRIVER=Microsoft Access Driver (*.mdb);DBQ=
“
&
DBPath
‘
连接字符串
Set
conn
=
Server.CreateObject(
“
ADODB.Connection
“
)
‘
新建一个连接
conn.open Strconn
Set
rs
=
Server.CreateObject(
“
ADODB.RecordSet
“
)
‘
新建一个查询
strSQL
=
“
SELECT * FROM TBL_LYB
“
‘
查询的SQL语句
rs.Open strSQL,conn,
1
,
1
‘
执行查询
dim
showNext,showNum
showNext
=
Request(
“
showNext
“
)
showNum
=
Request(
“
showNum
“
)
if
showNext
=
“
True
“
then
rs.move(showNum)
Response.Write
“
&id=
“
&
rs(
“
ID
“
)
&
“
&user=
“
&
rs(
“
User
“
)
&
“
&ip=
“
&
rs(
“
IPAddress
“
)
&
“
&time=
“
&
rs(
“
wTime
“
)
&
“
&info=
“
&
rs(
“
Info
“
)
&
“
&other=
“
&
rs(
“
Other
“
)
Response.Write (
“
&readResult1=OK
“
)
rs.close
set
rs
=
nothing
conn.close
set
conn
=
nothing
%
>
今天的文章asp读4分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/29305.html