User Session expired


I have a set of crystal reports that I need to let the users view on ASP pages. Therefore I used the Crystal Smart Viewer. It has been working well, until recently, about 3 days back, the user keep experiencing "User Session has expired" when trying to retrieve the pages.

I thought that there may be some issues with the database, so I rebooted it, and it works well for a while, before the "User session has expired" thingy turns up again.

If I run the crystal report directly without going through the ASP page, the report can be displayed.

Can someone help me with why and how can I resolve this problem? Thanks!

I'm using Crystal Report 7, MS SQL database.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sataAuthor Commented:
We have tried the solutions provided in Crystaldecisions, but still it's not working. I changed the error message, and got the below:

Error returned: 20534 meaning: Error detected by database DLL.

Could the problem be at the database end?
How are you calling the report?

Are you passing the correct logon information?

Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

sataAuthor Commented:

I include the connection part for one of the reports:


Dim vReportName
vReportName = "Handover Confirmation Report.rpt"
If Not IsObject (Session("oApp")) Then                              
      Set Session("oApp") = Server.CreateObject("Crystal.CRPE.Application")
End If  
Dim vPath, iLen
vPath = Request.ServerVariables("PATH_TRANSLATED")                    
While (Right(vPath, 1) <> "\" And Len(vPath) <> 0)                      
      iLen = Len(vPath) - 1                                                  
      vPath = Left(vPath, iLen)                                              

session("oApp").LogonServer "PDSSQL.DLL", CStr(session("strdbServer")), Cstr(session("strdbDatabase")), CStr(session("strdbUserID")) , CStr(session("strdbPassword"))      

Set Session("oRpt") = Session("oApp").OpenReport(vPath & vReportName, 1)
set Session("oRptOptions") = Session("oRpt").Options
Session("oRptOptions").MorePrintEngineErrorMessages = 0

set Session("ParamCollection") = Session("oRpt").Parameterfields        

Dim Param1, Param2, Param3, Param4, Param5, Param6
set Param1 =  Session("ParamCollection").Item(1)
set Param2 =  Session("ParamCollection").Item(2)
set Param3 =  Session("ParamCollection").Item(3)
Dim ParamValue1, ParamValue2, ParamValue3, ParamValue4, ParamValue5, ParamValue6
ParamValue1 = Session("strUserID")
ParamValue2 = Request.Form("select1")
ParamValue3 = Request.Form("select2")

Call Param1.SetCurrentValue (CStr(ParamValue1), 12)
Call Param2.SetCurrentValue (CStr(ParamValue2), 12)
Call Param3.SetCurrentValue (CDbl(ParamValue3), 7)
On Error Resume Next                                                  
      If Err.Number <> 0 Then                                              
            Response.Write ("Error returned: " & err.number & " meaning: " & err.description)

            If IsObject (Session("oPageEngine")) Then                              
                  set Session("oPageEngine") = nothing
            end if
            set Session("oPageEngine") = Session("oRpt").PageEngine            
      End If                                                                

      <TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
      <BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">
      <OBJECT ID="CRViewer"
            WIDTH=100% HEIGHT=95%
      <PARAM NAME="EnableRefreshButton" VALUE=1>
      <PARAM NAME="EnableGroupTree" VALUE=0>
      <PARAM NAME="DisplayGroupTree" VALUE=0>
      <PARAM NAME="EnablePrintButton" VALUE=1>
      <PARAM NAME="EnableExportButton" VALUE=1>
      <PARAM NAME="EnableDrillDown" VALUE=1>
      <PARAM NAME="EnableSearchControl" VALUE=1>
      <PARAM NAME="EnableAnimationControl" VALUE=1>
      <PARAM NAME="EnableZoomControl" VALUE=1>

      <SCRIPT LANGUAGE="VBScript">
      Sub Page_Initialize
            On Error Resume Next
            Dim webBroker
            Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
            if ScriptEngineMajorVersion < 2 then
                  window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
                  CRViewer.ReportName = Location.Protocol + "//" + Location.Host +"/scrreports/rptserver.asp"
                  Dim webSource
                  Set webSource = CreateObject("WebReportSource.WebReportSource")
                  webSource.ReportSource = webBroker
                  webSource.URL = Location.Protocol + "//" + Location.Host + "/scrreports/rptserver.asp"
                  webSource.PromptOnRefresh = True
                  CRViewer.ReportSource = webSource
            end if
      End Sub

<%End If%>

Set objCatRecord = Nothing
Set objCatResponse = Nothing
Set objCat = Nothing
One of the causes of the 20534 is invalid logon information

session("oApp").LogonServer "PDSSQL.DLL", CStr(session("strdbServer")), Cstr(session("strdbDatabase")), CStr(session("strdbUserID")) , CStr(session("strdbPassword"))

I don't know ASP that well but is SESSION needed before each string?
Is it retrieving the correct information?

sataAuthor Commented:

I don't know ASP that well either, so I can't comment why is "session" required. :(  I inherited this set of codes.
The codes have been running well for 2 years, so I don't think it's likely that it suddenly pick up the wrong values. Anyway, I need try hardcoding the values into:

session("oApp").LogonServer "PDSSQL.DLL", "servername", "dbname", "user", "userpasswd"
(assuming the above are my actual values.)

But the error still occurs.

The interesting thing is, once I reboot my app server and database server, it will run for sometime, and after a while, stop working...
I don't know.  The only thing that makes any sense is that you aren't releasing the sessioin when a report closes.

sataAuthor Commented:
so is this wrong or right?

do you think the dll is corrupted?
Could be but I doubt it.  Has anything changed on your network?

sataAuthor Commented:
No, nothing change in the network. I have checked again and again with the network guys.

Is there a way to check if the login is working fine? Anyway to establish that without using the report?
Are you using IIS?  You may need to verify that Session State is enabled in the IIS properties
sataAuthor Commented:
I have tried all means, but doesn't seems to be able to get the crystal report back to a stable state. At times it's just go abnormal, at times it's ok.

Is there any other possible solution to this? If not, I guess I just have to close this question....
Closed, 250 points refunded.
Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.