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

VB Code Code:
  1. Dim CrystApp As CRAXDRT.Application
  2. Dim CrystRpt As CRAXDRT.Report
  3.  
  4. Set CrystApp = New CRAXDRT.Application
  5. Set CrystRpt = CrystApp.OpenReport(App.Path & "\PymntRpt.rpt")
  6. 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

VB Code Code:
  1. Dim CrystApp As CRAXDRT.Application
  2. Dim CrystRpt As CRAXDRT.Report
  3.  
  4. Set CrystApp = New CRAXDRT.Application
  5. Set CrystRpt = CrystApp.OpenReport(App.Path & "\PymntRpt.rpt")
  6. 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,
Nasreen