Solved

using DSN for crystal report through asp (500 points)

Posted on 2006-11-12
6
266 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
ID: 17928084
0
 

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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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…
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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