Valentina Win32 data access component like libmysql.dll?

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jan 7 01:45:30 CST 2008


On 7/1/08 4:19 AM, "Kenley Lamaute" <klamaute at gmail.com> wrote:

Hi Kenley,

So you need then Valentina COM, right?
Yes it exists, and has name " Valentina COM"  VCOM.

Only difference from mySQL, that we provide not 20-30 simple C-like methods.
Our VCOM model has classes Vconnection, Vdatabase, Vcursor, Vfield... So you
will work with OO model.

And yes you can do any SQL commands that Valentina supports including stored
procedures.


> I am currently using the following MQL code ('C++ / Java' like language
> supplied by my broker on the MetaTrader platform) to write data to a local
> MySQL database on a Vista installation.
> 
> As you can see from the import statement below, MySQL has a "libmysql" COM
> component that allows one to simply read, write or call stored procs on a
> MYSQL database from any high level programming language / Win32 application.
> 
> 
> MQL code >>
> //+------------------------------------------------------------------+
> //|                                                 TicksInMySQL.mq4 |
> //|                      Copyright (c) 2006, MetaQuotes Software Corp. |
> //|                                        http://www.metaquotes.net |
> //+------------------------------------------------------------------+
> #property copyright "Copyright (c) 2006, MetaQuotes Software Corp."
> #property link      "http://www.metaquotes.net"
> 
> *#import "libmysql.dll"*
> int mysql_init(int db);
> int mysql_errno(int TMYSQL);
> int mysql_real_connect(int TMYSQL, string host, string user, string
> password,
>                        string DB,int port,int socket,int clientflag);
> int mysql_real_query(int TMSQL, string query, int length);
> void mysql_close(int TMSQL);
> #import
> int mysql;
> //+------------------------------------------------------------------+
> //| expert initialization function                                   |
> //+------------------------------------------------------------------+
> int init()
>   {
>    mysql = mysql_init(mysql);
>    if(mysql != 0)
>        Print("allocated");
>    string host = "localhost";
>    string user = "user";
>    string password = "pass";
>    string DB = "test";
>    int clientflag = 0;
>    int port = 3306;
>    string socket = "";
>    int res =
> mysql_real_connect(mysql,host,user,password,DB,port,socket,clientflag);
>    int err = GetLastError();
>    if(res == mysql)
>        Print("connected");
>    else
>        Print("error=", mysql, " ", mysql_errno(mysql), " ");
>    return(0);
>   }
> //+------------------------------------------------------------------+
> //| expert deinitialization function                                 |
> //+------------------------------------------------------------------+
> int deinit()
>   {
>    mysql_close(mysql);
> //----
>    return(0);
>   }
> //+------------------------------------------------------------------+
> //| expert start function                                            |
> //+------------------------------------------------------------------+
> int start()
>   {
>    string query = "";
>    int length = 0;
> 
>    for (int i=0; i<OrdersTotal(); i++)
> // For all orders in the terminal
>      {
>     if(OrderSelect(i, SELECT_BY_POS)==true)
>                         //If there is the next and our currency pair
>        {
> 
>    query = StringConcatenate("insert into
> ticks(margin,freemargin,date,ask,bid,symbol,equity) values(",
>                              AccountMargin(), ",", AccountFreeMargin(),
> ",\"",
>                              TimeToStr(CurTime(), TIME_DATE|TIME_SECONDS),
> "\",",
>                              NormalizeDouble(Ask, 4), ",",
> NormalizeDouble(Bid, 4),
>                              ",\"", OrderSymbol(), "\",", AccountEquity(),
> ");");
>    length = StringLen(query);
>    mysql_real_query(mysql, query, length);
>    int myerr = mysql_errno(mysql);
>    if(myerr > 0)
>        Print("error=",myerr);
>   }
> //+------------------------------------------------------------------+
> }}
> 
> <<
> 
> 
> Does Valentina embedded server db have a similar component to
> libmysql.dllto read, write and call stored procedures?
> 
> If so, will someone please point me to documentation and usage examples?

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list