Libraries: AdoSuite v 1.0

 

AdoSuite v 1.0:

Classes for working with databases through ODBC and OLE DB interfaces.

When it comes to processing of large data amounts, it is not very rational to use files. For this purpose database management systems (DBMS) have been developed. There are already some solutions written in mql4 for interacting with different DBMS'es, and now I want to share my library written in mql5.

It allows you to:

  • Work with most of the popular databases using built-in ODBC and OLE DB providers
  • Write data providers for specific databases to extend the functionality or increase the perfomance
  • Catch exceptions and provide the error information into the calling code
The library is provided with documentation and some sample code. Hope, it will help you to make a startup.

Author: Alexander

 

Hi Alexander,

thanks for making these libraries available. Somehow, I have tried to install them and get some of your samples working but I hit the same issue over and over again. When I try to run one of the scripts, I get the error message:

 

2011.03.11 09:06:22 1 Inserting a record (GBPUSD,H1) Cannot open 'C:\Program Files\MetaTrader 5\MQL5\Libraries\AdoSuite.dll' (14001)

 

The AdoSuite.dll is in the correct directory, .NET 2.0 framework is installed, I have followed all of your instructions, but yet I always hit this error, even with the simplest script where I only do an include of your library.


Any idea where this may come from? (by the way the issue is not because ADOSuite.dll is not in the directory: if i remove the dll from the directory then the error is a different one: "Cannot open AdoSuite.dll'(126)")

 

Neil.

PS: even a script as simple as the one below fails with the same 14001 error. Could it be that your DLL needs to 'see' other DLLs?

//+------------------------------------------------------------------+

//|                                                      TestADO.mq5 |

//|                        Copyright 2011, MetaQuotes Software Corp. |

//|                                              http://www.mql5.com |

//+------------------------------------------------------------------+

#property copyright "Copyright 2011, MetaQuotes Software Corp."

#property link      "http://www.mql5.com"

#property version   "1.00"

//+------------------------------------------------------------------+

//| Script program start function                                    |

//+------------------------------------------------------------------+

#include <Ado\Providers\OleDb.mqh>

void OnStart()

  {

   Comment("Test");

  }

//+------------------------------------------------------------------+

 

Hello,

You are likely dealing with an issue related to your terminal's data directory. There are 3 locations MT5 uses:

  • TERMINAL_PATH
  • TERMINAL_DATA_PATH
  • TERMINAL_COMMONDATA _PATH

 

Hi Alexander,

i copied all files right, but get the error:


'CAdoRecord::Values' - cannot call protected member function    DbDataAdapter.mqh    108    23

when i include one of this includes:

#include <Ado\Providers\OleDb.mqh>
#include <Ado\Providers\Odbc.mqh>
#include <Indicators\BsvSqlServer.mqh>

If i make 'CAdoRecord::Values public, I get the initialisation failed running my EA script.

Can you help?

Thanks


Ok, i solved it. Copmilation mith 64bot and it starts without errors.

 

The interesting project:

MT4-ODBC Bridge

https://github.com/onagano/mt4-odbc-bridge

This is a library for the popular trading terminal, MetaTrader4 (MT4), to give access to a relational database through ODBC interface. The main features are as follows.

  • Recording price data
  • Synchronizing trade status
  • Executing orders

MT4 has its own programming language, MQL4, for algorithmic trading. Though it is easy to learn, its expressiveness is very limited. People who want to execute more sophisticated algorithm tend to resort to outside of MT4, typically using DLL. But the native programming of DLLs is restricted to the Windows platform, which is not familiar to mainstream programmers of the recent open source movement.

MT4-ODBC Bridge (MOB in short) provides a buffer area onto a RDBMS like MySQL, PostgreSQL, SQLite, etc. Such database is general enough for the most open source programmers. You can access to the database by your familiar language, or maybe directly by SQL.

Reason: