dim conn,rs;//這裡如果是調用外部文件就必須定義這裡
這裡是數據庫創建聯連方法
sub opendb()
set rs=server.CreateObject("adodb.recordset")
set conn=server.CreateObject("adodb.connection")
conn.connectionstring="provider=microsoft.jet.oledb.4.0; data source="&server.mappath("datasource/hhinfo.mdb")
conn.open
end sub
//這裡是asp數據關閉方法
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