troubleshooting Question

connect Crystal Report to MySQL database in VB

Avatar of cybeh
cybeh asked on
Crystal Reports
6 Comments2 Solutions8041 ViewsLast Modified:
Hi,

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?

I tried
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
CRViewer1.ViewReport
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.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros