Libraries: MySQL for new MQL4 (tested in build 600)

 

MySQL for new MQL4 (tested in build 600):

Connecting to MySQL server from new MQL4

Author: Sergey

 

Good work!

Include file in MLQ4.zip is at this time older than an attached header file.

So after exctraction of zip, overwrite include file with an attached version is required to make it work.

 

Good work!

Include file in MLQ4.zip is at this time older than an attached header file.

So after exctraction of zip, overwrite include file with an attached version is required to make it work.

 
micclly:

Good work!

Include file in MLQ4.zip is at this time older than an attached header file.

So after exctraction of zip, overwrite include file with an attached version is required to make it work.


Thanks!

While I couldn't find any code difference between the files (I used git diff and unix diff tools.. am I missing something?), I strongly recommend always taking the one from Github repo anyways.

 
micclly:

Good work!

Include file in MLQ4.zip is at this time older than an attached header file.

So after exctraction of zip, overwrite include file with an attached version is required to make it work.


Thanks!

While I couldn't find any code difference between the files (I used git diff and unix diff tools.. am I missing something?), I strongly recommend always taking the one from Github repo anyways.

 
lukins:

While I couldn't find any code difference between the files (I used git diff and unix diff tools.. am I missing something?), I strongly recommend always taking the one from Github repo anyways.


I indeed agree with getting from GitHub, but the zip file contains invalid include file, is truth at this time :0


Here how to reproduce:

$ unzip MQL4.zip
Archive:  MQL4.zip
   creating: MQL4/
   creating: MQL4/Include/
  inflating: MQL4/Include/mql4-mysql.mqh
   creating: MQL4/Libraries/
  inflating: MQL4/Libraries/libmySQL.dll
   creating: MQL4/Scripts/
  inflating: MQL4/Scripts/mql4-mysql-example.mq4
$ diff -u MQL4
MQL4/           MQL4.zip        mql4-mysql.mqh
$ diff -u MQL4/Include/mql4-mysql.mqh mql4-mysql.mqh
--- MQL4/Include/mql4-mysql.mqh 2014-02-09 13:50:00.000000000 +0900
+++ mql4-mysql.mqh      2014-02-11 03:50:47.607291800 +0900
@@ -76,7 +76,7 @@
     if ( result != dbConnectId ) {
         int errno = mysql_errno(dbConnectId);
-        string error = mql4-mysql_ansi2unicode(mysql_error(dbConnectId));
+        string error = mql4_mysql_ansi2unicode(mysql_error(dbConnectId));
         Print("init_MySQL: mysql_errno: ", errno,"; mysql_error: ", error);
         return (false);
@@ -96,7 +96,7 @@
 //+----------------------------------------------------------------------------+
 bool MySQL_NoError(int dbConnectId) {
     int errno = mysql_errno(dbConnectId);
-    string error = mql4-mysql_ansi2unicode(mysql_error(dbConnectId));
+    string error = mql4_mysql_ansi2unicode(mysql_error(dbConnectId));
     if ( errno > 0 ) {
         Print("MySQL_NoError: mysql_errno: ", errno,"; mysql_error: ", error);
@@ -202,7 +202,7 @@
 //| Lovely function that helps us to communicate with ANSI DLLs, source:       |
 //| http://forum.mql4.com/60708                                                |
 //+----------------------------------------------------------------------------+
-string mql4-mysql_ansi2unicode(int ptrStringMemory)
+string mql4_mysql_ansi2unicode(int ptrStringMemory)
 {
   int szString = lstrlenA(ptrStringMemory);
   uchar ucValue[];
 
lukins:

While I couldn't find any code difference between the files (I used git diff and unix diff tools.. am I missing something?), I strongly recommend always taking the one from Github repo anyways.


I indeed agree with getting from GitHub, but the zip file contains invalid include file, is truth at this time :0


Here how to reproduce:

$ unzip MQL4.zip
Archive:  MQL4.zip
   creating: MQL4/
   creating: MQL4/Include/
  inflating: MQL4/Include/mql4-mysql.mqh
   creating: MQL4/Libraries/
  inflating: MQL4/Libraries/libmySQL.dll
   creating: MQL4/Scripts/
  inflating: MQL4/Scripts/mql4-mysql-example.mq4
$ diff -u MQL4
MQL4/           MQL4.zip        mql4-mysql.mqh
$ diff -u MQL4/Include/mql4-mysql.mqh mql4-mysql.mqh
--- MQL4/Include/mql4-mysql.mqh 2014-02-09 13:50:00.000000000 +0900
+++ mql4-mysql.mqh      2014-02-11 03:50:47.607291800 +0900
@@ -76,7 +76,7 @@
     if ( result != dbConnectId ) {
         int errno = mysql_errno(dbConnectId);
-        string error = mql4-mysql_ansi2unicode(mysql_error(dbConnectId));
+        string error = mql4_mysql_ansi2unicode(mysql_error(dbConnectId));
         Print("init_MySQL: mysql_errno: ", errno,"; mysql_error: ", error);
         return (false);
@@ -96,7 +96,7 @@
 //+----------------------------------------------------------------------------+
 bool MySQL_NoError(int dbConnectId) {
     int errno = mysql_errno(dbConnectId);
-    string error = mql4-mysql_ansi2unicode(mysql_error(dbConnectId));
+    string error = mql4_mysql_ansi2unicode(mysql_error(dbConnectId));
     if ( errno > 0 ) {
         Print("MySQL_NoError: mysql_errno: ", errno,"; mysql_error: ", error);
@@ -202,7 +202,7 @@
 //| Lovely function that helps us to communicate with ANSI DLLs, source:       |
 //| http://forum.mql4.com/60708                                                |
 //+----------------------------------------------------------------------------+
-string mql4-mysql_ansi2unicode(int ptrStringMemory)
+string mql4_mysql_ansi2unicode(int ptrStringMemory)
 {
   int szString = lstrlenA(ptrStringMemory);
   uchar ucValue[];
 

micclly:

Here how to reproduce:


You're totally right, shame on me. Seems like I didn't upload the correct archive. Sorry for making you rechecking this. I uploaded the updated archive and it will be up after it's approved by a moderator.

Thanks for letting me know!

 

micclly:

Here how to reproduce:


You're totally right, shame on me. Seems like I didn't upload the correct archive. Sorry for making you rechecking this. I uploaded the updated archive and it will be up after it's approved by a moderator.

Thanks for letting me know!

 

Nice job,

Can anyone give me a pointer as to making this work for 2008 64 bit server? I assume this is my issue, as it says 32 bit only above.

I took the above code and added my old Insert loop from my own MySQL EA and it Inserts first loop fine. It then crashes MT4 with libmysql.dll access violation error.

Any tips would be appreciated.

 

Nice job,

Can anyone give me a pointer as to making this work for 2008 64 bit server? I assume this is my issue, as it says 32 bit only above.

I took the above code and added my old Insert loop from my own MySQL EA and it Inserts first loop fine. It then crashes MT4 with libmysql.dll access violation error.

Any tips would be appreciated.

Reason: