Solved

Report Appears Blank despite Query containing records

Posted on 2006-11-29
1
230 Views
Last Modified: 2010-04-16
I have imported a Crystal Report into a VB6 Project and set the Reports Datasource as follows:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dim Report as New ControlsReport
Dim ADOrs as New ADODB.Recordset

Private Sub Form_Load( )

Dim ADOrs as New ADODB.RecordSet
Dim sql as String

   'sql = "Select * from qryTallyReport3;"
sql = "Select * from qryControlsScanned;"

ADOrs.Open sql, cn, adOpenDynamic, adLockPessimistic, adCmdText
Report.Database.SetDataSource ADOrs, 3, 1

CRViewr1.ReportSource = Report
CRViewer1.ViewReport

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~``

Now, the records show up if I switch the sql lines (commenting out the lower and using the upper).  These queries, however, contain identical fields and the only difference is qryControlsScanned is built off of qryTallyReport3, but uses a "Like" statement to limit the results.  If I open the query from within the Access database, it contains a record.  Also, when I open the Report from within Crystal Reports, the records show up.

The only problem I have is when I use the code as it appears, when the report is opened with the code, the Report is blank and "ADOrs" is empty.......

Anyone have an idea?
0
Comment
Question by:UDRCprogramer
1 Comment
 
LVL 1

Accepted Solution

by:
m00958 earned 500 total points
ID: 18080347
A couple of things that might be worth trying:

1) Try inserting this line before opening the recordset "ADOrs.CursorLocation = adUseClient"

2) Try using different locktypes and cursortypes. Maybe start with adOpenStatic and adLockReadOnly
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

816 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

12 Experts available now in Live!

Get 1:1 Help Now