<%@ LANGUAGE = VBScript codepage=65001%>
<%
'Option Explicit
response.charset="utf-8"
session.codepage=65001
Session.LCID=2057
%>
<!--#include file="../include/Lebi_Data.asp"-->
<%
Response.Buffer = True
On Error Resume Next
Dim SqlNowString
Dim Conn,Db
if IsSqlDataBase = 1 Then
SqlNowString = "GetDate()"
Else
Db = "../database/"&dbname&""
SqlNowString = "Now()"
End If

Sub connopen
	Dim ConnStr
	If IsSqlDataBase = 1 Then
		ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
	Else
		ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password="&pass&";Data Source = " & Server.MapPath(db)
	End If
	Set conn = Server.CreateObject("ADODB.Connection")
	conn.open ConnStr
	If Err Then
		err.Clear
		Set Conn = Nothing
		Response.Write "数据库连接失败"
		Response.End
	End If
End Sub 

Sub connclose
    conn.close
	Set conn=Nothing 
End Sub 
If Not IsObject(conn) Then 
      connopen()
Else
      connclose()
End If 
%>