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 » How to save the DB data to another SQLite db file in HomeBudget?
Re: How to save the DB data to another SQLite db file in HomeBudget? [message #14434 is a reply to message #14392] Tue, 26 February 2008 16:38 Go to previous messageGo to previous message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
To make a SaveAs menu and save the DB with another name is easy.
Just add a menu to HomeBudgetLayout, connect it with SaveAs callback, which contain something like
FileSel fsel;
if(fsel.ExecuteSaveAs(t_("Save Database As...")))
{
	if(FileExists(DB_file)) // DB_file is current DB name
	{
		if(FileCopy(DB_file, fsel.Get()))
			DB_file = fsel.Get();
		else
			PromptOK("Error saving file!");
	}
}


The hard (not so hard Confused ) part is if you want to make HomeBudget to load last DB, because of it current implementation which create DB session in GUI_APP_MAIN. You can do what you want with current implementation but must do a lot of test to see if current DB exist, you may move the creation of hb instance(from main), up, before DB initialization to use HomeBudget Serialize and get last DB file name from configuration file.
Or you may remake some part of HomeBudget and move somehow the DB initialization in HomeBudget Setup.
There are others alternatives, Just try. Or if you are a newbie (like me) try simple things until have the knowledge to do advanced stuff.


cdabbd745f1234c2751ee1f932d1dd75
 
Read Message
Read Message
Read Message
Previous Topic: Can't fetch row...
Next Topic: Table field name conflict?
Goto Forum:
  


Current Time: Mon Aug 25 10:51:36 CEST 2025

Total time taken to generate the page: 0.05681 seconds