Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

create connection by code

create connection by code

create connection by code


I have automated installing MySQL (version 5.1.73) to be specific for this purpose. MySQL server is up and running.

However I cannot connect using the default connection string. When looking at the configuration I see that I have not created a connection.

Do I need to create a connection first? No user intervention must be needed, I need full automation. How do I do that with code (using Visual Foxpro or another MySQL utility)?

Regards, Gerrit

NOTE: I don't need help for dnsless ODBC connections, I've been using that for at least 15 years.

RE: create connection by code

Quote (Gerrit Broekhuis)

I don't need help for dnsless ODBC connections, I've been using that for at least 15 years.
If that's the case, what is your problem?

You connect to MySQL via ODBC. Do you need help picking the right ODBC driver/version or figuring out the connection string for the driver you use? I know you from the VFP forum, so lets get more concrete about that. The only thing specific to VFP in that is that there are unicode drivers not suitable for VFP and drivers specifically targetted for PHP, also not suitable for VFP, so you just need the right driver for ANSI suitable for VFP. That also is true, if you finally configure your connection to work with utf8, for example, or utf8mb4 or whatever else. It's not a limitation of the Ansi driver to only deliver the latin1 ansi codepage.

Edit: You find the downloads for the Connector/ODBC driver at https://dev.mysql.com/downloads/connector/odbc/
For Windows, there are only 64bit and 32bit downloads, nothing specific to Unicode or Ansi, but once you download the 32bit msi setup (you need that, even if your Windows is 64bit) and install it you find two drivers: "MySQL ODBC 8.0 ANSI Driver" and "MySQL ODBC 8.0 Unicode Driver". The Ansi driver is what you use in VFP, Driver={MySQL ODBC 8.0 ANSI Driver} is part of the connection string you need to specify using that driver. If you downloaded and installed the 64bit MSI and don't see any drivers becoming available, that's because it only installs the 64bit drivers.


RE: create connection by code

Hi Chriss,

Well, I use NAVICAT for MySQL to take a look at my MySQL setup. Not that I create databases or tables with NAVICAT, I do that with VFP.

I see now that it’s no problem adding databases, without seeing a connection in NAVICAT. So I don’t need any code for that (my bad). However, when I want to actually see my MySQL setup in NAVICAT I first have to add a connection. Once I add a connection with a chosen name I can open the connection and see the database and it’s tables my application has added.

So it seems I have no problem, but only discovered that NAVICAT is “connection” unaware. Creating databases and tables does not change this.

Regards, Gerrit

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close