MySQL DB connection problem through ADO

This is the main technical forum for discussing problems that were encountered by users while developing PROMOTIC applications, and their possible solutions.

MySQL DB connection problem through ADO

Postby mister_b » Sun 19. Jan 2020 7:31:23

Dear Gentlemen,
I need to connect Promotic to MySQL database called 'iws' locally hosted in the same computer (Windows 10 x64 desktop).I tried the example that comes with the ADO object,Whenever I open the test panel in the example and try to open the table in the database it is throwing me that db is not open. I even tried different connection strings but no sequel. can somebody help me solve this issue

Connection String that I tried:
1) Server=myServerAddress;Port=3306;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
2)Provider =MySQLProv;Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Regards,
Mr.B
mister_b
 
Posts: 1
Joined: Sun 19. Jan 2020 7:18:37

Re: MySQL DB connection problem through ADO

Postby Kazimierz Heczko » Thu 06. Feb 2020 13:49:30

Correct connection string to MySQL database depends on version of the ODBC driver you have installed on the system. I recommend you to check page: http://www.connectionstrings.com, where you can find recommended connection strings for different databases, form MySQL too. PROMOTIC can use ODBC or OLEDB drivers, therefore you have to use any of the examples in these sections. Another important thing is, if you use 32-bit or 64-bit of PROMOTIC. And I can say, you have to use 32-bit driver to the database if you use 32-bit version of PROMOTIC (don't matter if you use 32-bit or 64-bit OS version).
Final connection string for MySQL database should be i.e.:
Driver={MySQL ODBC 5.2 ANSI Driver};Server=localhost;Port:3306;Database=myDataBase;User=myUsername;Password=myPassword;Option=3;

where Driver name have to be the same as you see in ODBC data sources manager.

Regards
Kazimierz Heczko
 
Posts: 68
Joined: Thu 13. Dec 2012 9:28:56


Return to I don't know how to...

Who is online

Users browsing this forum: No registered users and 1 guest

cron