[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

Error: "User session has expired"

I am trying to use an RPT trough an ASP page, but I getting "User session has expired". I am using a OLE DB to connect to SQL Server.
This is my code:
<%@ LANGUAGE="VBSCRIPT" %>

<!-- #include file="SmartViewerActiveX.asp" -->

<%
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=Name of the server;UID=sa;PWD=123;DATABASE=Name Database "

reportname = "prueba.rpt"
                                                               
If Not IsObject (session("oApp")) Then                              
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If                                                                


Path = Request.ServerVariables("PATH_TRANSLATED")                    
While (Right(Path, 1) <> "\" And Len(Path) <> 0)                      
iLen = Len(Path) - 1                                                  
Path = Left(Path, iLen)                                              
Wend                                                                  
                                                                     

If IsObject(session("oRpt")) then
     Set session("oRpt") = nothing
End if                                                    

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False
session("oRpt").DiscardSavedData

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

set Dep = session("ParamCollection").Item(1)

Call Dep.AddCurrentValue (CInt(request("DepEnvia")))


On Error Resume Next                                                  
session("oRpt").ReadRecords                                          
If Err.Number <> 0 Then                                              
 Response.Write "An Error has occured on the server in attempting to access the data source" & Err.Number
 Response.Write
Else

  If IsObject(session("oPageEngine")) Then                              
       set session("oPageEngine") = nothing
  End If
set session("oPageEngine") = session("oRpt").PageEngine
End If                                                                
%>
0
juliomexico
Asked:
juliomexico
  • 2
  • 2
1 Solution
 
juliomexicoAuthor Commented:
thanks for your help
0
 
juliomexicoAuthor Commented:
now the error is

-2147192184

Thank's mlmcc
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now