Solved

using DSN for crystal report through asp (500 points)

Posted on 2006-11-12
6
264 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
 
LVL 10

Expert Comment

by:Spykair
Comment Utility
0
 

Author Comment

by:Tiaanvanniekerk
Comment Utility
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
Comment Utility
Do you have that dll ?

Spykair.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

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

Accepted Solution

by:
Spykair earned 500 total points
Comment Utility
0
 
LVL 10

Expert Comment

by:Spykair
Comment Utility
Glad I could help.

Spykair
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

11 Experts available now in Live!

Get 1:1 Help Now