Discussion of article "SQL and MQL5: Working with SQLite Database" - page 5

 

Perhaps it will be useful to someone.


In MT4 the code works almost without changes

I did not create the database file for a long time. I.e. there are results, but there is no file.


Solution: write the full path to the file, for example like this:

  string path2 = TerminalInfoString(TERMINAL_DATA_PATH)+"\\MQL4\\Files\\DB.db3";
   
  if(sql3.Connect(path2)!=SQLITE_OK) return;
 

Question


Apparently, this is a peculiarity of encoding.

If you write Russian text in the database, it looks crooked in SQLite studio (rhombuses with a question).

And if you enter Russian text manually, then it looks crooked in MT4.


Question: how to make the text display in the correct encoding so that the Russian text is visible?


 
MetaQuotes Software Corp.:

New article SQL and MQL5: Working with SQLite Database has been published:

Author: o_O

Hey!

Since build 2170, this library is giving scope errors. Could you please update it as to follow the new MQL5 scope 'guidelines'? Thanks!

Btw great work!

 
A new article implementing a native SQL solution can be found here: https://www.mql5.com/en/articles/7463
SQLite: Native handling of SQL databases in MQL5
SQLite: Native handling of SQL databases in MQL5
  • www.mql5.com
MQL5 is a perfect solution for algorithmic trading since it is as close to C++ as possible in terms of both syntax and computation speed. The MetaTrader 5 platform offers its users the modern specialized language for developing trading robots and custom indicators allowing them to go beyond simple trading tasks and create analytical systems of...
 
Quintos:

I think I found a memory leak:

In SQLite3Base.mqh line 250

 Should be:

Good catch!
(Any tools avilable to check these things?)
 
ByteImg.mqh is running wrong, please fix it!