Results 1 to 3 of 3

Thread: [RESOLVED] Need Help About Crystal Reports

Threaded View

  1. #1

    Thread Starter
    Member psychofoo's Avatar
    Join Date
    Jun 2005
    Posts
    48

    Resolved [RESOLVED] Need Help About Crystal Reports

    hi, im new in this forum and im also a newbie in crystal reports. I want to display a particular records to crystal reports Im having a hard time viewing the report. this is my code but there's a problem

    ***************************
    Dim rpt As Report
    Dim obj As Form1
    Dim rsuser As Recordset
    Dim strsql As String

    Set ocnn = New ADODB.Connection
    ocnn.Open dbconnection

    Set rsuser = New Recordset
    Set rsuser.ActiveConnection = ocnn

    strsql = "select * from customer"
    rsuser.Open strsql, ocnn, adOpenKeyset, adLockReadOnly


    If Not rsuser.EOF Then
    While Not rsuser.EOF

    rpt.DiscardSavedData 'The problem is right here

    rpt.Database.SetDataSource (rsuser)
    CR.ReportSource = rpt

    rsuser.MoveNext
    Wend
    End If

    rsuser.Close
    Set rsuser = Nothing

    ************************************

    the error msg states that , object variable or with block variable not set.
    I dont know what to do. I dont know if my connection to database is correct or wrong... and also the components that i will going to add. i need ur help guys. thanx in advance
    Last edited by psychofoo; Jun 5th, 2005 at 09:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width