Results 1 to 10 of 10

Thread: problem with report

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    50

    problem with report

    sir,pls help me i have problem in my program when i click the print to generate a report i have an error message that say, "Logon failed. Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". Im using MySQL ODBC 3.51 Driver, and I'm using crystal report 10. Hope you can help me urgent pls.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: problem with report

    mySQL has it's own driver. Why are you using a MS driver? They don't make an mySQL driver.

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    50

    Re: problem with report

    this is my code when i click the Print

    Code:
    Private Sub mnu_RoomInv_Click()
      frmReport.Caption = ViewReport(frmReport.CRViewer1, App.Path & "/reports/room_inventory.rpt", Screen.Width, Screen.Height, mdiMain.mnu_RoomInv.Caption)
    End Sub
    
    
    Function ViewReport(CRViewer As CrystalActiveXReportViewer, _
                   sFilename As String, _
                   lngWidth As Long, lngHeight As Long, _
                   Optional sFormTitle As String = "Report Viewer", _
                   Optional bGroupTree As Boolean = False) As String
    
      Dim Appl As New CRAXDRT.Application
      Dim Report As New CRAXDRT.Report
      Dim x As Long
        Set Report = Appl.OpenReport(sFilename)
          CRViewer.Width = lngWidth
          CRViewer.Height = lngHeight - 1000
          
          With Report
            .DiscardSavedData
            .EnableParameterPrompting = True
          End With
          
          CRViewer.ReportSource = Report
          CRViewer.ViewReport
        ViewReport = StrConv(Trim(sFormTitle), vbProperCase)
      Set Report = Nothing
      Set Appl = Nothing
    
    End Function

    Hope you can help me...thanks

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: problem with report

    The code you posted has nothing to do with the connection string that you probably included in the report connection. You need to change that.

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    50

    Re: problem with report

    sir can you give me a sample for connecting the report

  6. #6
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: problem with report

    I don't use the controls of CR to do reports. I use the ADO passing og recordsets that I have already taken from the database. But youvwill need to go in the designer and make a connection to your database then test the connection. After that your report should workvas planned.

  7. #7

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    50

    Re: problem with report

    sir, Im using CrystalActiveXReport can you give me an example. thanks

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: problem with report

    Moved to reporting section

  9. #9

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    50

    Re: problem with report

    Is there a way to connect MySQL ODBC 3.51 Driver in Crystal Report X. can you give me a sample of code to connect that. hope you can help me thanks....

  10. #10
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: problem with report

    Sample code won't help if you don't go intovthe CR designer and set it up to use the code...

    It does not matter which method you use you still have to go into the designer to set it up.

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