juliomexico
asked on
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.a sp" -->
<%
Set cnn = Server.CreateObject("ADODB .Connectio n")
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=Name of the server;UID=sa;PWD=123;DATA BASE=Name Database "
reportname = "prueba.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("Cryst alRuntime. Applicatio n")
End If
Path = Request.ServerVariables("P ATH_TRANSL ATED")
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").MorePrintE ngineError Messages = False
session("oRpt").EnablePara meterPromp ting = False
session("oRpt").DiscardSav edData
set session("ParamCollection") = Session("oRpt").Parameterf ields
set Dep = session("ParamCollection") .Item(1)
Call Dep.AddCurrentValue (CInt(request("DepEnvia")) )
On Error Resume Next
session("oRpt").ReadRecord s
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("oPageEng ine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
This is my code:
<%@ LANGUAGE="VBSCRIPT" %>
<!-- #include file="SmartViewerActiveX.a
<%
Set cnn = Server.CreateObject("ADODB
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=Name of the server;UID=sa;PWD=123;DATA
reportname = "prueba.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("Cryst
End If
Path = Request.ServerVariables("P
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
session("oRpt").MorePrintE
session("oRpt").EnablePara
session("oRpt").DiscardSav
set session("ParamCollection")
set Dep = session("ParamCollection")
Call Dep.AddCurrentValue (CInt(request("DepEnvia"))
On Error Resume Next
session("oRpt").ReadRecord
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("oPageEng
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End If
%>
ASKER
now the error is
-2147192184
Thank's mlmcc
-2147192184
Thank's mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER