Re: [gnome-db] Sqlite database creation
- From: Christophe Bastin <bastin chris gmail com>
- To: Daniel Espinosa <esodan gmail com>
- Cc: gnome-db-list gnome org
- Subject: Re: [gnome-db] Sqlite database creation
- Date: Mon, 27 Oct 2014 09:43:56 +0100
Thanks for the quick response.
I found the problem. There was a mismatch between the app executable and the database names.
In my CMAKE file :
set (EXEC_NAME "test")
and in my application.vala
conn = Gda.Connection.open_from_string ("SQLite",
"DB_DIR=.;DB_NAME=test", null, Gda.ConnectionOptions.NONE);
It compiles correctly and creates the "test" executable.
But when I launch the app, the error is "uncaught error: file is encrypted or is not a database (gda_connection_error, 5)"
It doesn't create the database file and try to open the exec.
The workaround is to rename the EXEC_NAME or the DB_NAME.
Le ven 24 oct 2014 à 19:13, Daniel Espinosa <esodan gmail com> a écrit :
I've used:
cnn = Gda.Connection.open_from_string ("Sqlite", "DB_NAME=test.db;DB_DIR=.",null, Gda.ConnectionOptions.READ_ONLY);
and it is working for me. Using libgda 5.2 and Vala 0.22 on Ubuntu GNOME 14.04.
Could you give me some code example.
I've used this one:
using Gda;
class Application : Object {
public Gda.Connection cnn { get; set; }
public int run ()
{
cnn = Gda.Connection.open_from_string ("SQLite", "DB_NAME=test;DB_DIR=.",null, Gda.ConnectionOptions.READ_ONLY);
return 0;
}
static int main (string[] args)
{
var app = new Application ();
return app.run ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]