troubleshooting Question

trying to connect to MySQL with CreateConnection

Avatar of PeterTrefren
PeterTrefrenFlag for United States of America asked on
Visual Basic Classic.NET ProgrammingMySQL Server
7 Comments1 Solution328 ViewsLast Modified:
I'm trying to connect to a MySQL database using System.Data.Common.  I'm need some help trying to figure out the connection string.  I've changed some of the connection infromation but basically this is what I have so far.  I'm planning on distributing this so I'm thinking that OleDB might be the best way given that I won't have to worry about distributing an MySQL driver.  I'm currently working in VB 2005.

factory = System.Data.Common.DbProviderFactories.GetFactory("System.Data.oledb")
        cnPTracker = factory.CreateConnection
        cnPTracker.ConnectionString = "Provider=****; " _
                                        & "Data Source=****;"" )" _
                                        & "Initial Catalog=PTracker;Uid=****;Pwd=****;" _
                                        & "trusted_connection=true;encrypt=true; " _
                                        & "trustservercertificate=true;"

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 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 1 Answer and 7 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