Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Report Appears Blank despite Query containing records

Posted on 2006-11-29
1
Medium Priority
?
248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Progress
Introduction to Processes

730 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