Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: How to Pass recordset from vb6 application Post Reply Post New Topic
Author Message
huren
Newbie
Newbie


Joined: 30 May 2012
Location: Germany
Online Status: Offline
Posts: 2
Quote huren Replybullet Topic: How to Pass recordset from vb6 application
    Posted: 04 Jun 2012 at 7:32pm
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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.000 seconds.