Discussion of article "How to Access the MySQL Database from MQL5 (MQL4)" - page 14
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
started popping up all the time, what does that mean?
when executing my code in this line.
if(DB==-1){DB=MySqlConnect(Host, User, Password, Database, Port, Socket, ClientFlag);}
res = MySqlCursorOpen(DB, "SELECT id, account, symbol FROM `current` WHERE account="+account);
In MQL all strings are Unicode and you pass them instead of ANSI.
That's why the dllka crashes.
In MQL all strings are Unicode and you pass them instead of ANSI.
That's why the dll crashes.
If I remove the condition, everything works, in general, you can redo it differently, I just don't understand why it crashes.
//if(DB==-1){
DB=MySqlConnect(Host, User, Password, Database, Port, Socket, ClientFlag);
//}
res = MySqlCursorOpen(DB, "SELECT id, account, symbol FROM `current` WHERE account="+account);
In MQL all strings are Unicode and you pass them instead of ANSI.
That's why the dll crashes.
If I remove the condition, everything works, in general, you can redo it differently, just do not understand why it crashes
//if(DB==-1){
DB=MySqlConnect(Host, User, Password, Database, Port, Socket, ClientFlag);
//}
res = MySqlCursorOpen(DB, "SELECT id, account, symbol FROM `current` WHERE account="+account);
What is the logic? Do you have a connection before this code? What is DB equal to before the condition? If the DB variable is not initialised, it's probably because of this.
And in the last example you open a connection to the database normally and that's why the cursor works too
Do the scripts supplied with the DLL work?Greetings Eugene!
Thank you for the script. I decided to implement it in my project. But at the stage of testing the scripts that you have attached to the project I have 1 bug, not clear. ReadIni does not work. Maybe I do something wrong, but it always returns empty values from ini. What could be the reason? I suspect that it does not find the file on the specified path, but I checked from different directories everything is correct and in place.
If I prescribe the data for the connection in the code directly, everything works fine.
I am using mt4.Greetings Eugene!
Thank you for the script. I decided to implement it in my project. But at the stage of testing the scripts that you have attached to the project I have 1 bug, not clear. ReadIni does not work. Maybe I do something wrong, but it always returns empty values from ini. What could be the reason? I suspect that it does not find the file on the specified path, but I checked from different directories everything is correct and in place.
If I prescribe the data for the connection in the code directly, everything works fine.
I am using mt4.You should check the paths... UAC most likely affects. What path do you set to INI? To the terminal directory or Data?
And here's another problem: Russian text is inserted in karakaziaby. Of course I understand that the dll is recoding, but my database is UTF-8. What should I do to insert readable Russian text...? it will make my life much easier...?
Yes, the conversion to ASCII is going on, there is also a remark about it from Chinese colleagues. As soon as I have time I will try to fix it.
You need to check the paths... UAC probably affects it. What path do you set to INI? To the terminal directory or Data?
There are examples in your archive...in them I left everything as it is. I just changed the ini.
The problem is solved. I was stupid myself. Earlier the folder with MT4 and the folder with data were united. Now the folder for data is stored in a special section of Windows. Now the path is correct to take TerminalInfoString(TERMINAL_DATA_PATH) instead of TerminalPath().
There are examples in your archive...in them I left everything as it was. Just changed the ini.
The problem is solved. I was stupid myself. Earlier the folder with MT4 and the folder with data were united. Now the folder for data is stored in a special section of Windows. Now the path is correct to take TerminalInfoString(TERMINAL_DATA_PATH) instead of TerminalPath().
Hmm... it is somewhere in the old library, in the latest versions (posted in the discussion) I've corrected it if my memory serves me correctly :)
Ok. then the UTF problem remains. i'll try to solve it this week till the weekend, if i'm not overworked.