Home » U++ Library support » U++ SQL » Changing Database [Solved]
Changing Database [Solved] [message #55063] |
Wed, 07 October 2020 20:24 |
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 
Thank you 
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
|
|
|
Goto Forum:
Current Time: Fri Apr 25 19:09:49 CEST 2025
Total time taken to generate the page: 0.02734 seconds
|