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



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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

- using ado would usually be slower
- if you want to use ado though, have you selected "fielddefinitions" in the data explorer?
The .mdb driver is for mdb files.  The TTX driver is different.  Did you install it when you installed Crystal?

gderoeckAuthor Commented:
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.
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

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! ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gderoeckAuthor Commented:
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.
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
gderoeckAuthor Commented:
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.
Glad I could help

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.