Zugriff auf myDB in mehreren Screens

Ich habe in Screen1 eine TinyDB mit Namen myDB definiert und mit Daten gefüllt.
Im zweiten Screen wollte ich diverse Aktionen mit myDB durchführen.
Allerdings wird myDB nicht gefunden, obwohl ich den gleichen Namen verwende.
Was mache ich falsch?

this may help you

Genügt es, das “set Namespace” einmal beim Initialisieren des Screens auszuführen oder muss es immer vor jedem Zugriff auf die TinyDB ausgeführt werden?

1 Like

It has been a matter of debate whether to keep switching the Namespace attribute of a single TinyDB component to access different data stores, versus just pulling in more TinyDB components in the Designer and permanently renaming them by purpose and setting their namespaces appropriately in the Designer.
(I recently posted a sample of this in the samples section at Fruit Stand: TinyDb Namespace sample)
where you can use the translate option for hopefully easier reading.

The tradeoff is between run time memory usage (how many XML files are open at the same time) versus code complexity (reusing a component for different purposes imposes a burden on the programmer to remember what purpose is currently being served by that component. (I dislike such burdens.)

Where are in your example “Fruit Stand” the
“set TinyDB_Prices namespace prices” and
“set TinyDB_Purchases namespace Purchases”?