Solved

using DSN for crystal report through asp (500 points)

Posted on 2006-11-12
6
269 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

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 

Author Comment

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

Accepted Solution

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

Expert Comment

by:Spykair
ID: 18052062
Glad I could help.

Spykair
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

617 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