Click to See Complete Forum and Search --> : Why do I only get half data shown on report?


lucia
November 12th, 2007, 04:03 PM
I am using vb6 and sql server 2000 and CR9.

I need select data from database and show it on CR.

I have code related to CR like this:

Code:
Dim crReport As New CRAXDRT.Report
Dim adoRS As New ADODB.Recordset
Dim strConnection As String, strReport As String

strConnection = "Driver={SQL Server};" & _
"Server=" & gsSQL & ";" & _
"Database=" & gsDatabaseName & ";" & _
"Uid=" & gstrUsr & ";" & _
"Pwd=" & gstrPwd

Set Report = crApp.OpenReport("\\development\Reports\" & strReport)

Set adoRS = New ADODB.Recordset
adoRS.Open "Temp_SQL", strConnection, adOpenDynamic, adLockBatchOptimistic
crReport.Database.Tables(1).SetDataSource adoRS, 3

Temp_SQL is a view to collect all data we want. I got all data I want but only half (or less) data shown on the report.
Any input will be highly appreciated.

JaganEllis
November 12th, 2007, 05:14 PM
Sorry - scrapping my reply after re-reading it!

Lugh
November 14th, 2007, 11:22 AM
Have you tried running the report outside VB, in the native Crystal Reports? Did you get all the expected data that way?

Have you tried examining the recordset in some other way, to see if the recordset contained all the expected records?

At this point, I'm not sure we have quite enough information to nail down where the error is occurring.