Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error connecting VFP to MySql database

Status
Not open for further replies.

AAnkit

Programmer
Feb 24, 2014
4
IN
Hi,

I am trying to connecting VFP to MySql database for the first time.

My system specifications:

Windows 7 (64 bit)
VFP9.0 SP2
MySQL ODBC 8.0 Unicode Driver
Version: 8.00.25.00

I installed WAMPSERVER 3.1.7
PHP 7.2.14
MySQL 5.7.24
MariaDB 10.3.12

Database server
• Server: MySQL (127.0.0.1 via TCP/IP)
• Server type: MySQL
• Server connection: SSL is not being used Documentation
• Server version: 5.7.24 - MySQL Community Server (GPL)
• Protocol version: 10
• User: root@localhost
• Server charset: UTF-8 Unicode (utf8)


User Name - root
Password - <blank>
Host name - localhost

Server: MySQL:3306
Database - test


I have written this string connection:

lcConnStr ="DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=127.0.0.1;"+;
"PORT=3306;DATABASE=test;USER=root;PASSWORD=;"


lnHandle = SQLStringConnect(lcConnStr)
IF lnHandle < 0
=AERROR(laError)
? laError[2]
RETURN
ENDIF


** Error: Connectivity error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

******************************************************************
Note: I have added data source (MySQL ODBC 8.0 Unicode Driver)
under User DSN & System DSN
and test result is Connection Successful
In ODBC Data Source Administrator.
******************************************************************

Please help. Thanks.
 
make sure you install the 32bit ODBC driver.

there's a different (32bit) ODBC control panel under windows accessories in the start menu.

hth

n
 
Start C:\WINDOWS\syswow64\odbcad32.exe

Do you see a MySQL driver there? If not you only installed the 64 bit version. VFP is 32bit.
You can use utf8mb4 also with the 32 bit ANSI driver.

Go to and pick Windows and your version 5.7.24,

You could also try the newest driver, nothing speaks againstit being able to connect to an older MySQL version.



Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top