To download the CSP files from this tutorial, click TutorialSamples_vb.zip. For more information about using the samples, see Code examples.
<META HTTP
Dim UserID, Password, APS, Aut
'Retrieve the user information from the form
APS = Request.querystring("APS")
UserID = Request.form("UserID")
Password= Request.form("Password")
'Create an Enterprise SessionManager.
Set SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr")
Response.Write "Couldn't create SessionManager"
'Log the user onto Crystal Enterprise.
Set Sess = SessionManager.Logon(UserID, Password, APS, Aut)
'Check to see if logon failed.
'If the logon failed show a message box with an error description.
Response.Write "<SCRIPT language=""javascript""> " & _
" alert (""Sorry - you could not be logged on to " & _
"this server. Ensure that your user name and " & _
"password, as well as the APS name are correct. " & _
'Redirect the user back to the logon page.
'Response.Redirect "LogonForm.csp"
Response.Write "<META HTTP
Set IStore = Sess.Service ("", "InfoStore")
'Store the InfoStore object in the session.
'Retrieve the LogonTokenManager.
Set LogonTokenMgr = Sess.LogonTokenMgr
'Session("IStore") = Sess.LogonTokenMgr
'Retrieve a Logon Token and store it in the user's cookie file for later use.
Response.Cookies("LogonToken") = LogonTokenMgr.CreateLogonTokenEx("", 60, 100)
'Redirect the user to the site's home page.
Response.Redirect "home.csp
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |