Datagrid Stack Based Database

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
PeterG
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Datagrid Stack Based Database

Post by PeterG » Mon May 01, 2017 2:23 pm

HI
Is it possible to use a the datagrid in a stack based
Database.

Thanks
Peter G

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Datagrid Stack Based Database

Post by dunbarx » Mon May 01, 2017 2:44 pm

Hi.

Well, certainly, just as it is possible to use a table field, or any other ordered concoction of controls. You would have to write your own retrieval, sorting and relationship gadgetry.

I have done this sort of thing for many years, just like most others here, but I am not sure anyone but me would call it a true "database". That I write my own functionality is fine for me, but I assume that only touches on the typical functionality of a mainstream piece of software.

Craig Newman

PeterG
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: Datagrid Stack Based Database

Post by PeterG » Mon May 01, 2017 2:57 pm

Hi Craig
Thanks for your reply.
My reason for opting for stack based database is that there will most probably never be more that about 3000 records in this database. Am I correct in this approach, or should I go for MySQL or something similar.

Many Thanks
Peter G

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Datagrid Stack Based Database

Post by FourthWorld » Mon May 01, 2017 4:18 pm

As cards, you may find that going much above 3000 records may slow saves and to a lesser degree loading. But using custom properties in a stack file, either as a list in a single property or using array notation in a property set, can be lightning fast, with the additional benefit of separating UI from content so either can be changed independently of the other.

But if using a stack file for storage separate from your UI stacks is good, using a separate file can be even better. This can be text, XML, encoded arrays - many options are available.

And of course you can also use a database engine for storage, and the SQLite engine included with LC is a good one.

Which of these is best will depend on the specifics of your app. And if 3000 represents a maximum number of records you could even just keep storing data in fields on cards; I find the slowness with saving doesn't really become very noticeable until it gets closer to 5000.

That said, unless this is just a quickie thing for your own personal use, there are many benefits from separating data and UI, so I usually advocate any external storage and paging data into a single card for viewing.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Datagrid Stack Based Database

Post by TerryL » Sat May 20, 2017 6:38 pm

Hi gagsoft. Here are links to a LiveCode lessons stack (Beginner Lab) that includes an example of a simple stack database (Rolodex). Maybe it will give you some ideas for your project. Terry
Rolodex.jpg
Direct Download: https://docs.google.com/uc?export=downl ... mJqZ0JZdE0
Website Download: https://tlittle72.neocities.org/info.html
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Datagrid Stack Based Database

Post by MaxV » Tue May 23, 2017 8:23 am

However keep in mind that SQLite is embedded in livecode.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Datagrid Stack Based Database

Post by TerryL » Mon Jun 12, 2017 6:35 pm

I made another stack database with a table field that looks similar to a datagrid table using BN's brilliant alternating colored lines routine. It could have other applications. Also with subtractive search, easy setup & data entry, sorting, three reports to PDF. Terry
DataBase.jpg
DataBase.jpg (18.66 KiB) Viewed 5935 times
Attachments
Stack DataBase.zip
(7.38 KiB) Downloaded 287 times
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/openxtalk.html

chipsm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 244
Joined: Wed May 11, 2011 7:50 pm

Re: Datagrid Stack Based Database

Post by chipsm » Tue Jun 27, 2017 1:52 pm

I just found your sample and it gives me ideas.
I new that there were ways of creating a datagrid type of interface and this is great.
Thanks for your contribution. I am studying this sample with great expectations.
Clarence Martin
chipsm@themartinz.com

Post Reply