hi all
pls need help to retrieve fields from sql to crystal report
so what I did ?
created this code it is working 100% to connect the report to sql DB and only get the first row of the data so what I need
each row in different report pages as a group of data and connected to textobject in the report
by coding with ADO and recordset and settext like the code
u may use my code to try something new

by the way
using vb6,crystal report8,mssql7
just to clear it
thank u

Dim Report As New CrystalReport1
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "provider=sqloledb;server=smug;uid=sa;pwd=;initial catalog=course"
Set rs = New ADODB.Recordset
rs.Open " select * from contract where contno='" & 1 & "'", cn, adOpenDynamic, adLockOptimistic
Report.flatno.SetText (rs!flatno)
Report.contno.SetText (rs!contno)
Report.contday.SetText (rs!contday)
Report.contrenttype.SetText (rs!contrenttype)
Report.contpriceno.SetText (rs!contpriceno)
Set rs = Nothing
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub