How to use TinyDB for changing a record

428 views
Skip to first unread message

Dittmar

unread,
Jan 27, 2015, 11:33:45 AM1/27/15
to mitappinv...@googlegroups.com
Hi,

i am a beginner with app programming and MIT App Inventor.
i want to create a data base with several fields (like an adress DB with Name, Street, City, Date of Birth,..)
With TinyDB i am able to add and delete records. That works fine.
But how can i change existing records to change let's say the street name but hold all other field entries ?

All examples i found only adds/deletes entries.


Thanks for your help.
Dittmar

SteveJG

unread,
Jan 27, 2015, 12:09:22 PM1/27/15
to
If you can change an individual item in your Address database depends on how you structured the database. If you stored  Name, Street, City  under a single TinyDB tag, you can not change only a single element, however if you have a Tag    for each of Name ,   Street ....   you can change a single item.    The easiest way to do this is to change the values in the List(s) that you populate your database with.   For a DB to work, you have to use both Lists and   one of AI2 DB options (TinyDB, TinyWebDB, Fusion Tables ...and if you use special techniques, Goolge spreadsheets or MySQL etc)      However, what you can do with your database depends on how you structure it.  If you did it to best advantage you can use a TextBox to change an item in a List ...say the Name at record number 22  or 2 or whatever.   ...and yes, it is possible to change a single element in     yourname, yourstreet, yourcity   when that is a string by parsing the string..complicated but that could work too although it is awkward.

The following examples may help (possibly you have not seen all of them).

Dittmar

unread,
Jan 27, 2015, 3:41:54 PM1/27/15
to mitappinv...@googlegroups.com
Thank you for your answer.

I will see through the links (some of them i knew already).

Dittmar
Reply all
Reply to author
Forward
0 new messages