- <!-- #include file="..configGB.asp" -->
- <!-- #include file="..SXNAVersion.asp" -->
- <%
- Public db
- If DBcate="admin" Then
- db="../data/"&dbname
- End If
- If DBcate="/" then db="data/"&dbname
- Function ConnectDB()
- err.clear
- On error resume next
- set conn = Server.CreateObject("ADODB.Connection")
- connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
- conn.Open connstr
- If Err Then
- Response.Write Err.Number & Err.Description
- response.end
- err.Clear
- End If
- set ConnectDB=conn
- End Function
- Function CloseDB(conn)
- If IsObject(Conn) Then conn.close : set conn=nothing
- End Function
- Function CheckParameter(byRef source,strType,default)
- On Error Resume Next
- If strType="int" Then
- If IsEmpty(source) Then
- source=default
- ElseIf IsNumeric(source) Then
- source=CLng(source)
- ElseIf source="" Then
- source=default
- Else
- source=default
- End if
- If Err.Number<>0 Then
- CheckParameter=False
- Else
- CheckParameter=True
- End If
- ElseIf strType="dtm" Then
- If IsEmpty(source) Then
- source=default
- ElseIf IsDate(source) Then
- source=CDate(source)
- ElseIf source="" Then
- source=default
- Else
- response.write source
- response.end
- End if
- If Err.Number<>0 Then
- CheckParameter=False
- Else
- CheckParameter=True
- End If
- ElseIf strType="sql" Then
- source=CStr(Replace(source,chr(39),chr(39)&chr(39)))
- Else
- If Err.Number<>0 Then response.end
- End If
- End Function
- If IsSqlDataBase = 1 Then
- Const SqlDatabaseName = ""
- Const SqlPassword = ""
- Const SqlUsername = ""
- Const SqlLocalName = "(local)"
- SqlNowString = GetDate()
- Else
- SqlNowString = formatdatetime(Now(),2)&" "&formatdatetime(Now(),4)
- End If
- Function CheckRights()
- If session(SessionStr&"SXNAPASS")<>userpass and Request.Cookies(SessionStr&"SXNAPASS")<>userpass then
- response.redirect "login.asp"
- End If
- End Function
- Function CheckRights2()
- If session(SessionStr&"SXNAPASS")<>userpass and Request.Cookies(SessionStr&"SXNAPASS")<>userpass then
- CheckRights2=False
- Else
- CheckRights2=True
- End If
- End Function
- %>