Results 1 to 3 of 3

Thread: [RESOLVED] Crystal Report 9 on VB6

  1. #1

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Resolved [RESOLVED] Crystal Report 9 on VB6

    Hi! I was told to use DSN for crystal report so that I can access or view my report from vb6. I tried creating system dsn and when i run my app i get this error "Logon Failed. Details:IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified." But when I open the report to crystal report viewer it will ask me for the datasource first before it will display the result. What am I missing here?

    here's my code:
    Code:
    Public Sub openConnection()
      Set oConn = New ADODB.Connection
    
      With oConn
        .Provider = "SQLOLEDB"
        .CursorLocation = adUseClient
        .Properties("Data Source").Value = ".\SQLEXPRESS"
        .Properties("Initial Catalog").Value = "InvtyDB"
        .Properties("Integrated Security").Value = "SSPI"
        .ConnectionTimeout = 30
        .Open
      End With
    End Sub
    Code:
    Option Explicit
      Dim cReport As CRAXDRT.Report
      Dim Appn As New CRAXDRT.Application
      Dim sSQL As String
      Dim sSQL1 As String
      Dim rsTemp As ADODB.Recordset
    
    Private Sub cmdDisplay_Click()
      Screen.MousePointer = vbHourglass
      Set Appn = CreateObject("CrystalRunTime.Application")
      Set cReport = Appn.OpenReport(App.Path & "\InvtyReport.rpt")
      CRViewer91.ReportSource = cReport
      cReport.ParameterFields(1).AddCurrentValue MonthName(Month(DTPStart.Value))
      cReport.ParameterFields(2).AddCurrentValue CStr(DTPStart.Year)
    '  cReport.ParameterFields(3).AddCurrentValue (DTPStart.Value)
    '  cReport.ParameterFields(4).AddCurrentValue (DTPEnd.Value)
      CRViewer91.ViewReport
      Screen.MousePointer = vbDefault
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
      Set cReport = Nothing
      Set Appn = Nothing
    End Sub
    Last edited by Simply Me; Jul 4th, 2009 at 12:22 AM.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  2. #2

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: Crystal Report 9 on VB6

    anyone who has idea on this please?

    Is there any other way of displaying report in vb6 using crystal report viewer other than using DSN?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  3. #3

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [RESOLVED] Crystal Report 9 on VB6

    self resolved
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

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