I created an "ODBC driver" in the windows control panel, so, while the design time, I just select the "ODBC" and the new driver I created in the database expert. After that, I am using the command to create my own SQL for the report. Everything works fine during design time.
But the problem is, I need to dynamically connect to different server, and prefer not to add any ODBC driver in the control panel. Is that possible?
Dim m_Report As New CrystalReport2
m_Report.Database.LogOnServer "p2ssql.dll", "localhost", "myDatabase", "root", "" -> The database built with empty password
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = m_Report
Screen.MousePointer = vbDefault
But i gave the error message of
Run-Time error '-2147189155 (80047e5d)':
Failed to open the connection
Details: [Database Vendor Code: 17]
I am using VB6, MySQL 5.0 and CR XI
Please advice. Thanks in advance.
p/s: It's not a must for me to use .LogOnServer, but just I do not know any other solution.