/// <summary>
/// Create or open an SQLite database.
/// This must be called before any SQL methods.
/// When a table is created it must have first column as "Id INTEGER PRIMARY KEY".
/// </summary>
/// <param name="fileName">The full path to the SQLite database file (usually with extension db).</param>
/// <returns>A label to identify the database.</returns>
public static Primitive ConnectSQLite(Primitive fileName)
{
try
{
ExtractDll();
DataBase dataBase = GetDataBase(fileName, false);
if (null == dataBase)
{
dataBase = new DataBase(fileName, NextID());
dataBase.ConnectSQLite();
}
dataBases.Add(dataBase);
return(dataBase.name);
}
catch (Exception ex)
{
Utilities.OnError(Utilities.GetCurrentMethod(), ex);
}
return("");
}