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:
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
VB Code 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,
Nasreen




Reply With Quote