How to Pass Recordset From Vb6 Application to Crystal Report 10 ?
I have written the following code for passing recordset . still no luck. I am getting an error of "table not found?"
Following is the code
Dim m_Report as new CrystalReportSmple
Private sub Form1() Dim strconn As String Dim rsCompany As ADODB.Recordset Screen.MousePointer = vbHourglass
Set m_Connection = New ADODB.Connection Set rsCompany = New ADODB.Recordset ''''''''''''''Connection Sting''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' strconn = "DRIVER={MySQL ODBC 3.51 Driver};user=test;password=test;server=localhost;Database=TestDatabase;option=16427" m_Connection.Open strconn
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Query = "SELECT FirstName,LastName,Address,City FROM tblcustomers " rsCompany.Open Query, m_Connection, adOpenStatic, adLockOptimistic
''''''''''''''''''''''''''''''''''''''''''''''Getting Error at this line'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
m_Report.Database.SetDataSource rsCompany
''''''''''''''''''''''''''''''''''''''''''''''Mapping to unbound fields'''''''''''''''''''''''''''''''''''''''''''''''''''''''' With m_Report .UnboundString1.SetUnboundFieldSource "{tblcustomers.FirstName}" .UnboundString2.SetUnboundFieldSource "{tblcustomers.LastName}" End With ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' View the report CRViewer1.ReportSource = m_Report CRViewer1.ViewReport Screen.MousePointer = vbDefault
End Sub
------------- Regards,
Huren
|