Results 1 to 3 of 3

Thread: Providing database logon credentials to CrystalReports XI thru VB6.0

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    3

    Providing database logon credentials to CrystalReports XI thru VB6.0

    I am trying to provide database logon credentials to Crystal Reports XI thru VB 6.0 (via ODBC) for Oracle 10g server database.

    I have Oracle client 9.2.0.4.0 on my PC.

    I am using the LogOnServer method in VB to log on to the database providing a secure connection to all tables within the database. Logon sever syntax is

    LogOnServer <databaseDLL>, <Server>, <Database>, <UserID>, <Password>

    where <Server> is the ODBC Data Source Name and <database> is the name of the database

    How do I find the <databaseDLL> to use in my code?

    Thanks,

  2. #2
    Addicted Member
    Join Date
    Jan 2001
    Location
    MPLS
    Posts
    187

    Re: Providing database logon credentials to CrystalReports XI thru VB6.0

    If i recall correctly the dll specified should be "crdb_odbc.dll" for ODBC connections. Try it out.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2008
    Posts
    3

    Re: Providing database logon credentials to CrystalReports XI thru VB6.0

    I found the solution to this problem. This code is working fine. (using the LogOnServer method and crdb_oracle.dll and crdb_odbc.dll)

    Thanks,

    Saloni



    Option Explicit
    Dim App As New CRAXDRT.Application
    Dim rptReport As New CRAXDRT.Report


    Private Sub Form_Load()
    Dim sReportName As String
    sReportName = GetReportName(gintReports)

    PopulateReport sReportName

    End Sub

    Private Sub Form_Resize()
    CrystalActiveXReportViewer1.Top = 0
    CrystalActiveXReportViewer1.Left = 0
    CrystalActiveXReportViewer1.Height = ScaleHeight
    CrystalActiveXReportViewer1.Width = ScaleWidth

    End Sub

    Private Sub PopulateReport(sReportName As String)

    Screen.MousePointer = vbHourglass
    App.LogOnServer "crdb_oracle.dll", gstrDatabaseName, "", gstrUserName, gstrPassword
    Set rptReport = App.OpenReport(gstrReportPath & sReportName)
    rptReport.Database.LogOnServer "crdb_odbc.dll", gstrDatabaseName, "", gstrUserName, gstrPassword
    CrystalActiveXReportViewer1.Refresh
    CrystalActiveXReportViewer1.ReportSource = rptReport
    CrystalActiveXReportViewer1.ViewReport
    Screen.MousePointer = vbDefault

    Exit Sub
    End Sub

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