Solved

Report Appears Blank despite Query containing records

Posted on 2006-11-29
1
226 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

19 Experts available now in Live!

Get 1:1 Help Now