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] db.Open() crashes app
[SQLite] db.Open() crashes app [message #12839] Tue, 20 November 2007 20:43 Go to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Using this code in a button click handler (just for testing opening sqlite database) the app crashes...

void DatabaseApp::OnClickOpenDbButton ()
{
bool nodb = false;

Sqlite3Session db;
db.LogErrors(true);

FileIn fi("HB.db3");
if(fi.IsError() || fi.GetSize() <= 0)
{
nodb = true;
}
fi.Close();


String str=ConfigFile("HB.db3");
if(!db.Open(str))
{
Exclamation(t_("Can't create or open database file"));
return;
}
}

Debugging this function I can see

Sqls.h
SqlSession& GetSession() const { return cn->GetSession();

cn empty!

and then it crashes...

Am I forgetting to do something before this?

Thanks

Alex
Re: [SQLite] db.Open() crashes app [message #12859 is a reply to message #12839] Thu, 22 November 2007 12:48 Go to previous message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Done.

I removed all the "meat" of the HomeBudget project and just left the skeletton and then I saw that I forgor the SQL Variable.

Alex
Previous Topic: Handling multiple rows data in sqlite3
Next Topic: Setting SQLite language?!
Goto Forum:
  


Current Time: Sun Apr 28 22:14:04 CEST 2024

Total time taken to generate the page: 0.02748 seconds