% option explicit %> <% response.buffer = true response.addheader "cache-control", "private" response.addheader "pragma", "no-cache" response.expiresabsolute = #January 1, 1990 00:00:01# response.expires = now() - 1 response.addheader "Cache-Control", "must-revalidate" response.addheader "Cache-Control", "no-cache" dim SESSION_ID SESSION_ID = session("user_id") if isnumeric(SESSION_ID) then SESSION_ID = clng(SESSION_ID) else SESSION_ID = 0 end if if (SESSION_ID > 0) then response.redirect "calendar.asp" end if %>
![]() |
|||||||||||||
|
|
|||||||||||||
|
|
|||||||||||||
|
|||||||||||||
<% Public Function RequestValue(tmpString, tmpFormat, defaultValue) Dim retValue Select Case tmpFormat Case FORMAT_INTEGER If tmpString = "" Then retValue = defaultValue Else If IsNumeric(tmpString) Then retValue = CInt(tmpString) Else retValue = defaultValue End If End If Case FORMAT_STRING If tmpString = "" Then retValue = defaultValue Else retValue = Trim(tmpString) End If Case FORMAT_LONG If tmpString = "" Then retValue = defaultValue Else If IsNumeric(tmpString) Then retValue = CLng(tmpString) Else retValue = defaultValue End If End If Case FORMAT_DOUBLE If tmpString = "" Then retValue = defaultValue Else If IsNumeric(tmpString) Then retValue = CDbl(tmpString) Else retValue = defaultValue End If End If End Select RequestValue = retValue End Function function OpenDb(m_user, m_passwd) dim str_db dim rs, cmd ' strconn=strconn & "USER ID=;PASSWORD=;" str_db = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("db/password.mdb") Set rs = Server.CreateObject("ADODB.Recordset") Set cmd = Server.CreateObject("ADODB.Command") ' Init the ADO objects & the stored proc parameters cmd.ActiveConnection = str_db cmd.CommandText = "qry_login" cmd.CommandType = 4 'adCmdStoredProc cmd.Parameters.Append cmd.CreateParameter("@username",200,&H0001,USERNAME_LENGTH,m_user) set rs =cmd.Execute set cmd = nothing set OpenDb = rs end function %>