Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Report Appears Blank despite Query containing records

Posted on 2006-11-29
1
Medium Priority
?
253 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 1500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Introduction to Processes
Screencast - Getting to Know the Pipeline

773 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