Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    2

    Unanswered: Native connection in Crystal Report 9 Viewer

    Hi All,
    I am using Crystal Report 9 and VB6.

    I want to display the reports using the native connection to my MS SQL 2005 dbase

    And I use the following code to view the crystal report

    Code:
    Dim CrystApp As CRAXDRT.Application
    Dim CrystRpt As CRAXDRT.Report
    
    Set CrystApp = New CRAXDRT.Application
    Set CrystRpt = CrystApp.OpenReport(App.Path & "\PymntRpt.rpt")
    CrystRpt.Database.Tables(1).SetLogOnInfo "MyServer", "MyDb", "MyUsr", "MyPwd"
    I get the following Error :
    Details: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    But when I use the same code to connect using ODBC connection it work properly


    Code:
    Dim CrystApp As CRAXDRT.Application
    Dim CrystRpt As CRAXDRT.Report
    
    Set CrystApp = New CRAXDRT.Application
    Set CrystRpt = CrystApp.OpenReport(App.Path & "\PymntRpt.rpt")
    CrystRpt.Database.Tables(1).SetLogOnInfo "MyODBC", "MyDb", "MyUsr", "MyPwd"
    This code work with ODBC connection.

    In my case, I need to connection using Native connection method

    How can I solve this problem and connect to my SQL Sever using native connection method in Crystal Report 9.

    With regards,
    Klari

  2. #2
    Join Date
    Jul 2009
    Posts
    1
    one year and a few days later..

    Hi klari

    I am using Crystal Report 10 and PHP and i had the same Error.
    I'm using ODBC Connection. And i solve the problem today.

    Try this:
    CrystRpt.Database.Tables(1).SetLogOnInfo "", "", "MyUsr", "MyPwd"

    without Server and DB

    (sry for my bad english ☺)

Posting Permissions

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