Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

using DSN for crystal report through asp (500 points)

Posted on 2006-11-12
6
Medium Priority
?
271 Views
Last Modified: 2012-08-14
HI can some please assist?
I want to use a defined ODBC datasource in my code,but it keeps on opening a local session?
If Some one can show me where and how to force a DSN and not current session?
Tiaan
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%@ Language=VBScript CodePage=65001 %>
<%


Dim path,iLen
Dim x, y, ReportName

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

path = path & ReportName


Set objFactory = CreateObject("CrystalReports.ObjectFactory")
Set Session("oClientDoc") = objFactory.CreateObject("CrystalClientDoc.ReportClientDocument")
Session("oClientDoc").Open path



Session("oClientDoc").databaseController.logon sUser,sPass


'Pass Parameters to the Report Object here.  An error will appear if they are not passed in the correct order or the data types are incorrect.
Passparameter "Callid", cstr(request("Callid"))


'Response.Redirect "interactiveViewer.asp"
Response.Redirect "CrystalReportsViewer.asp"
Response.Redirect "ActiveXViewer.asp"


'This passes parameters to the report.
Public Sub PassParameter(strParamName, ParamValue)  
Dim ParamIndex
Dim objParam
Dim objNewParam
    ParamIndex = Session("oClientDoc").DataDefinition.ParameterFields.Find(strParamName, 0)
    Set objParam = Session("oClientDoc").DataDefinition.ParameterFields.Item(ParamIndex)
    Set objNewParam = objParam.Clone
    objNewParam.CurrentValues.Add ParamValue
    Session("oClientDoc").DataDefController.ParameterFieldController.Modify ParamIndex, objNewParam
End Sub

     %>
0
Comment
Question by:Tiaanvanniekerk
  • 4
  • 2
6 Comments
 

Author Comment

by:Tiaanvanniekerk
ID: 17928102
Hi Spykair
Thnx for the response
the error i receive is;

Error Type:
clientdoc.dll (0x80041015)
Failed to connect to server "tiaan". Error returned from Windows Sockets API : 0.

 which is this line

Session("oClientDoc").Open path

I thought of adding this;
Sub Session_OnStart()
    Session.Timeout = 10
    set Session("oClientDoc") = Server.CreateObject("ADODB.Connection")
    Session("oClientDoc").Open "Provider=MSDASQL.1;Password=sa;Persist Security Info=True;User ID=sa;Data Source=HEATLIVELOCAL"
End Sub

Sub Session_OnEnd()
    Session("oClientDoc").close
    set session("path") = nothing
    Session.Abandon
End Sub

But how to use it to force it I don't know!and it doesn't work
0
 
LVL 10

Expert Comment

by:Spykair
ID: 17928118
Do you have that dll ?

Spykair.
0
[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

 

Author Comment

by:Tiaanvanniekerk
ID: 17928136
yes and I re-registered it in system 32
0
 
LVL 10

Accepted Solution

by:
Spykair earned 2000 total points
ID: 17928142
0
 
LVL 10

Expert Comment

by:Spykair
ID: 18052062
Glad I could help.

Spykair
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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