Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » sqlite and Execute
sqlite and Execute [message #25823] Sun, 14 March 2010 12:18 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I followed the tutorial and I come to the following very simple code that should perform a query on an existing database:

#include <CtrlLib/CtrlLib.h>
using namespace Upp;

#define LAYOUTFILE <c16/c16.lay>
#include <CtrlCore/lay.h>
#include <plugin/sqlite3/Sqlite3.h>


class c16 : public Withc16Layout<TopWindow> {
public:
	void FillRankingTables();
	typedef c16 CLASSNAME;
	c16();
};

c16::c16()
{
    CtrlLayout(*this, "Window title");

    Sqlite3Session sqlite3;
    if(!sqlite3.Open(ConfigFile("c16.db"))) {
        Exclamation("Can't create or open database file");
        return;
    }

    SQL = sqlite3;
    SQL.Execute("insert into PUNTI_GIOCATORI (IDFSI,IDCIRCOLO,SIGLAPROV,SIGLAREG) select ID_FSI,IDCIRCOLO,SIGLAPROV,SIGLAREG from ISCRITTI");
}

void c16::FillRankingTables()
{
}

GUI_APP_MAIN
{	c16().Run();
}

No compile error (The .lay file contains a button and is irrilevant... I guess).

The relevant part is the SQL.Execute(...) statement that does nothing. If I copy the string inside Execute and paste into SQliteManager (a Firefox plugin) to run the query it is executed without problem and the table is filled with the right values.
Instead SQL.Execute does not perform the query. What am I missing?
It should be not related to a missing schema file.

Thank you.
Luigi

[Updated on: Sun, 14 March 2010 12:19]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Workaround: Hybridizing SqlExp usage
Next Topic: sqlite busy/lock timeout patch
Goto Forum:
  


Current Time: Sat Apr 27 14:41:31 CEST 2024

Total time taken to generate the page: 0.02082 seconds