<%
dim conn
'on error resume next
if XH_SeverTypes="access" then
'==========================================ACCESS数据库
dim connstr
connstr="DBQ="+server.mappath(""&XH_Mdb_Server&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
elseif XH_SeverTypes="sql" then
'==========================================sql数据库
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={SQL Server};server="&XH_sql_server&";UID="&XH_sql_UID&";PWD="&XH_sql_PWD&";Database="&XH_sql_Database&""
end if
IF Err.Number <> 0 Then
Response.Write errormsg("数据库连接错误，请检查数据库连接文件！",0)
Response.End
End IF
set rs=server.createobject("adodb.recordset")
function closeconn()
set rs=nothing
conn.close
set conn=nothing
end function
%>
