[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Access 2000, Crystal Reports 8, and choice between ADO or straight query

Posted on 2003-11-19
Medium Priority
Last Modified: 2008-03-10


First, I'm using Crystal Reports 8 Developer edition.  I have created a report based on a query from an Access 2000 database.  I'd like to be able to run this report from an Active Server Page on our intranet where I can declare just one parameter - the date values.  Here are my questions:

1)  Would this be better or more efficient if I were to run this report by calling a .ttx file and ADO recordset as opposed to going straight to the query?

2)   I was experimenting with the example files from Crystal Decisions.  When I was experimenting with using a .ttx file and ADO connection, I kept getting the error that my DSN was not available or didn't have the correct driver.  In all the comments from the experts here, I never heard of anyone having to declare which driver - just the .mdb driver, which was set up according to the instrctions.  Am I missing something?  I did actually open the example database and it did ask me if I wanted to convert it to the current version.  Would this be the problem and, if so, how do I fix it?

Thank you in advance.
Question by:gderoeck
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
  • 3
  • 3
  • 3
LVL 13

Expert Comment

ID: 9785170
- using ado would usually be slower
- if you want to use ado though, have you selected "fielddefinitions" in the data explorer?
LVL 101

Assisted Solution

mlmcc earned 200 total points
ID: 9787790
The .mdb driver is for mdb files.  The TTX driver is different.  Did you install it when you installed Crystal?


Author Comment

ID: 9789036
Ok, I'm probably missing something....

EwaldL - how do you select fielddefinitions in the data explorer?  Not sure I know what you're talking about

mlmcc - when I used the examples from Crystal Designs, it came with a .mdb database for an example.  It had me make a DSN connection through administrative tools (Win 2000 Pro) with the Access driver to that example database.  

I'm sure the TTX driver was installed - I could set it up as a datasource in Crystal.  I have a feeling that the issue is with the .mdb driver, since in my ASP page, I'm trying to create an ADO recordset before Crystal is even called.  That's where I'm getting stuck.  Thoughts?

Thank you both for your responses.
Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

LVL 13

Accepted Solution

EwaldL earned 200 total points
ID: 9790218
create a new report, in the data explorer select "more datasources" -> "active data" -> "active data (field definitions only)". now you can point to the ttx file. i wouldn't recommend this though unless you have a good reason for chosing recordsets. a native connection tends to be heaps faster!  ... and easier! ;-)

Author Comment

ID: 9791578
Ok, I'm going to go with your method.  I've created the report, linked it to a query in my Access 2000 database.  All works fine within the report itself.

I set up an ASP page to call the report.  When I try and run the ASP page, I get an error saying I can't connect to the datasource (which is an error message I put in) and a box that pops up saying my User Session has expired.  Here is the code I'm using for the ASP page:

<title>Crystal Reports ASP Example - Displaying a Simple Report</title>


reportname = "CallPerformancePeriod.rpt"


If Not IsObject (session("oApp")) Then                              
Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")
End If                                                                

Path = Request.ServerVariables("PATH_TRANSLATED")                    
While (Right(Path, 1) <> "\" And Len(Path) <> 0)                      
iLen = Len(Path) - 1                                                  
Path = Left(Path, iLen)                                              

If IsObject(session("oRpt")) then
      Set session("oRpt") = nothing
End if

'Response.Write (path & reportname)

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False




On Error Resume Next                                                  
If Err.Number <> 0 Then                                              
  Response.Write "An Error has occured on the server in attempting to access the data source"

  If IsObject(session("oPageEngine")) Then                              
        set session("oPageEngine") = nothing
  End If
set session("oPageEngine") = session("oRpt").PageEngine
End If                                                                

<TITLE>Seagate ActiveX Viewer</TITLE>

      WIDTH=100% HEIGHT=95%
<PARAM NAME="EnableRefreshButton" VALUE=0>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>

Sub Page_Initialize
      On Error Resume Next
      Dim webBroker
      Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
      if ScriptEngineMajorVersion < 2 then
            window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
            CRViewer.ReportName = "rptserver.asp"
            Dim webSource
            Set webSource = CreateObject("WebReportSource.WebReportSource")
            webSource.ReportSource = webBroker
            webSource.URL = "rptserver.asp"
            webSource.PromptOnRefresh = True
            CRViewer.ReportSource = webSource
      end if
End Sub

Again, the view comes up, but gives me that error.  Thanks in advance.
LVL 13

Expert Comment

ID: 9795245
to start with asp make sure you are trying the sample applications first

have a look at

here in SimplePreviewReport.asp, change
 <!-- #include file="SmartVieweractivex.asp" -->    

 <!-- #include file="SmartViewerHTMLFrame.asp" -->    

this will avoid any possible trouble with installing the active x viewer on a client by using pure html

Author Comment

ID: 9802058
Thank you both, but I found out the problem.  I fixed it by setting up an OLE-DB connection and not going through DSN.  It seems a lot more efficient to do it this way and it works great.  I split the points between the two of you - you both were very helpful, thank you.
LVL 101

Expert Comment

ID: 9808097
Glad I could help


Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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 this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

656 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