
Crystal Report 8.5 and VB 6
Hi,
I have the following codes in my programs. when I run this
program, I can only see one line( the last row ) of my selection where
This program should return more than 100 rows. I am wondering if text
object be be dynamic ?
I could not figure how to use database field. Any helps will be
greatly appreciated.
P.S I am using vb6 and sql server 7.0
Thank in advance,
patrick
Private Sub form1_load()
Dim Report As New CRystalreport1
report.PrintOut
End Sub
'CRystalreport1
Private Sub Report_Initialize()
Dim mrstBld As New ADODB.Recordset
Dim mstrquery As String
If mrstBld.State = adStateOpen Then
mrstBld.Close
End If
mstrquery="select customerid,name from customer where
customer.addeddate > 01/02/2000"
mrstBld.Open mstrquery, myconnection, adOpenKeyset, adLockOptimistic
mrstBld.MoveFirst
While Not mrstBld.EOF
TxtCustomerID.SetText mrstBld!customerid
txtname.seltext mrstBld!name
mrstBld.MoveNext
Wend
End Sub