Solved

Report Appears Blank despite Query containing records

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

932 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