forked from rosh/MQL5Book
22 lines
1,005 B
MQL5
22 lines
1,005 B
MQL5
//+------------------------------------------------------------------+
| |
//| DBinit.mq5 |
| |
//| Copyright 2022, MetaQuotes Ltd. |
| |
//| https://www.mql5.com |
| |
//+------------------------------------------------------------------+
| |
#property description "Creates a new or opens existing database."
| |
#property script_show_inputs
| |
| |
input string Database = "MQL5Book/DB/Example1";
| |
| |
#include "..\..\Include\DBSQLite.mqh"
| |
| |
//+------------------------------------------------------------------+
| |
//| Script program start function |
| |
//+------------------------------------------------------------------+
| |
void OnStart()
| |
{
| |
DBSQLite db(Database);
| |
PRTF(db.getHandle()); // 65537 / ok
| |
PRTF(FileIsExist(Database + ".sqlite")); // true / ok
| |
}
| |
//+------------------------------------------------------------------+
|