Solved

User Session expired

Posted on 2003-11-02
14
1,220 Views
Last Modified: 2007-12-19
Hi,

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.
0
Comment
Question by:sata
14 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 9668663
0
 
LVL 1

Author Comment

by:sata
ID: 9668742
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?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9671141
How are you calling the report?

Are you passing the correct logon information?

mlmcc
0
 
LVL 1

Author Comment

by:sata
ID: 9675356
Hi,

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)                                              
Wend    

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                                                  
      Session("oRpt").ReadRecords                                          
      If Err.Number <> 0 Then                                              
            Response.Write ("Error returned: " & err.number & " meaning: " & err.description)
      Else

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

      <HTML>
      <HEAD>
      <TITLE>Seagate Crystal Smart Viewer for ActiveX</TITLE>
      </HEAD>
      <BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">
      <OBJECT ID="CRViewer"
            CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
            WIDTH=100% HEIGHT=95%
                codebase="/viewer/activeXViewer/activexviewer.cab#Version=2,2,4,28">
      <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>
      </OBJECT>

      <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"
            else
                  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
            CRViewer.ViewReport
      
      End Sub
      -->
      </SCRIPT>

      </BODY>
      </HTML>
      
<%End If%>

<%
Set objCatRecord = Nothing
Set objCatResponse = Nothing
Set objCat = Nothing
%>
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9675731
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?

mlmcc
0
 
LVL 1

Author Comment

by:sata
ID: 9675749
Hi,

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...
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 100

Expert Comment

by:mlmcc
ID: 9675762
I don't know.  The only thing that makes any sense is that you aren't releasing the sessioin when a report closes.

mlmcc
0
 
LVL 1

Author Comment

by:sata
ID: 9675771
so is this wrong or right?

do you think the dll is corrupted?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9676510
Could be but I doubt it.  Has anything changed on your network?

mlmcc
0
 
LVL 1

Author Comment

by:sata
ID: 9676671
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?
0
 
LVL 5

Expert Comment

by:erpeters
ID: 9681088
Are you using IIS?  You may need to verify that Session State is enabled in the IIS properties
0
 
LVL 1

Author Comment

by:sata
ID: 9847370
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....
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10667533
Closed, 250 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now