Solved

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

Posted on 2003-11-19
9
840 Views
Last Modified: 2008-03-10
Hello!

Situation:

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.
0
Comment
Question by:gderoeck
  • 3
  • 3
  • 3
9 Comments
 
LVL 13

Expert Comment

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

Assisted Solution

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

mlmcc
0
 
LVL 1

Author Comment

by:gderoeck
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.
0
 
LVL 13

Accepted Solution

by:
EwaldL earned 50 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! ;-)
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:gderoeck
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:

<%@ LANGUAGE="VBSCRIPT" %>
<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)                                              
Wend                                                                                
                                                                     
                                                   

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                                                  
session("oRpt").ReadRecords                                          
If Err.Number <> 0 Then                                              
  Response.Write "An Error has occured on the server in attempting to access the data source"
Else

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

<HTML>
<HEAD>
<TITLE>Seagate ActiveX Viewer</TITLE>
</HEAD>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript ONLOAD="Page_Initialize">

<OBJECT ID="CRViewer"
      CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
      WIDTH=100% HEIGHT=95%
        codebase="../viewer/activeXViewer/activexviewer.cab#Version=8,0,0,224">
<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>
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
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"
      else
            Dim webSource
            Set webSource = CreateObject("WebReportSource.WebReportSource")
            webSource.ReportSource = webBroker
            webSource.URL = "rptserver.asp"
            webSource.PromptOnRefresh = True
            CRViewer.ReportSource = webSource
      end if
      CRViewer.ViewReport
End Sub
-->
</SCRIPT>
</BODY>
</HTML>

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

Expert Comment

by:mlmcc
ID: 9792835
0
 
LVL 13

Expert Comment

by:EwaldL
ID: 9795245
to start with asp make sure you are trying the sample applications first
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/aspxmps8.exe.asp

have a look at
Beginner\BeginHere

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

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

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

Author Comment

by:gderoeck
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.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9808097
Glad I could help

mlmcc
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now