Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

using DSN for crystal report through asp (500 points)

Posted on 2006-11-12
6
Medium Priority
?
270 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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 …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

715 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