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 » Changing Database [Solved]
Changing Database [Solved] [message #55063] Wed, 07 October 2020 20:24
jimlef is currently offline  jimlef
Messages: 90
Registered: September 2020
Location: US
Member
In c#, a db was opened used then closed. In U++, it has proven very convenient to use a global SQL for most things.

The one exception, is that open my db at run time, so I select a default. But, while running, I choose a different db with the same schema.

I'm confused as to how to update SQL (and associated table views) to the new file? Currently, when I change the db file with
	Sqlite3Session sqlite3;
	
	if(!sqlite3.Open(selectdbfile.Get())) {
		Exclamation("Can't create or open database file\n");
		return;
	}

	SQL = sqlite3;

It compiles fine, but I get memory access error when I go to open a view?
	bar.Add(t_("List Invoices"), [=]{
		if(!invoiceswin.IsOpen())	{
			invoiceswin.InvoicesArray.ReQuery();
			invoiceswin.InvoicesArray.GoBegin();
			invoiceswin.Open(this);
			}
		});

U++/C++ noob needs more help haha Smile

Thank you Smile

Jim
Edit:

Mirek showed me the best option for my configurations, and now if the program doesn't have a db selected at run time, it let's you choose one. Sources updated at github

[Updated on: Thu, 08 October 2020 15:02]

Report message to a moderator

Previous Topic: Program changing column
Next Topic: libpq-fe.h in Alpine Linux
Goto Forum:
  


Current Time: Thu Apr 18 21:40:24 CEST 2024

Total time taken to generate the page: 0.03029 seconds