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 » Fix to Sqlite3Session::Open
Re: Fix to Sqlite3Session::Open [message #19919 is a reply to message #19915] Mon, 02 February 2009 10:56 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
Thanks!

Should not be the handle closed in Close and opened set to false again?

What about this fix:

bool Sqlite3Session::Open(const char* filename) {
	// Only open db once.
	ASSERT(NULL == db);
	current_filename = filename;
	// By default, sqlite3 associates the opened db with "main.*"
	// However, using the ATTACH sql command, it can connect to more databases.
	// I don't know how to get the list of attached databases from the API
	current_dbname = "main";
	if(SQLITE_OK == sqlite3_open(filename, &db))
		return true;
	if(db) {
		sqlite3_close(db);
		db = NULL;
	}
	return false;
}


Mirek
 
Read Message
Read Message
Read Message
Previous Topic: Conditional jump or move depends on uninitialised value(s)
Next Topic: few questions from a newbie
Goto Forum:
  


Current Time: Tue Jun 11 11:42:37 CEST 2024

Total time taken to generate the page: 0.02648 seconds