最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp连接access数据库 方法
时间:2022-07-02 22:39:36 编辑:袖梨 来源:一聚教程网
asp数据库连接方法很多的特别是asp与access数据库有几种今天我们讲到的连接access数据库 可以说是最好的方法了
先定义了Rs,Conn为全局变量,这样在其它文件调整当前文件时就可以直接使用了.
Dim Rs,Conn
Sub Db_connect()
Dpath ="dbaseMateyDBWeb_^%$#@.mdb"
Set Conn=Server.CreateObject("Adodb.connection")
Set Rs =Server.CreateObject("Adodb.Recordset")
Conn.connectionstring="Provider=Microsoft.Jet.oledb.4.0;Data source="&Server.MapPath(Dpath)
Conn.open
End sub
这里关判断rs与conn是否创建了,如果对象存在就关闭,这样可以节省系统资源.
sub closedb()
if isobject(Rs) then
if not(Rs is nothing) then
Rs.close
set Rs=nothing
end if
end if
if isobject(Conn) then
if not(Conn is nothing) then
Conn.close
set Conn=nothing
end if
end if
end sub
相关文章
- 鬼谷八荒逆天改命会覆盖吗 06-14
- 妄想山海植物分布图 06-14
- 栖云异梦第三章攻略 06-14
- 奥比岛手游烟花盛会活动要怎样玩 06-14
- 米坛社区官网入口-米坛社区app网页版官网登录入口v2.29.28 06-14
- iwara官网入口下载-iwara下载免费官网入口v4.87.8.4.5 06-14