CRUD SQLite example
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller
Re: CRUD SQLite example
Thanks for the update. Still I have no clue why when I compile as a standalone none of the buttons that are supposed to manipulate the datagrid are working.
I tried clear datagrid, and read into datagrid but nothing changes on the datagrid. Of course everything works fine while in development mode.
Any ideas?
I tried clear datagrid, and read into datagrid but nothing changes on the datagrid. Of course everything works fine while in development mode.
Any ideas?
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392
Re: CRUD SQLite example
I didn't even think to create a Standalone. You're right. The DtataGrid was frozen.
I tried everything I could think of. Nothing worked. So, I just deleted the DataGrid
and created a new one, with the same name. Works good now.
I tried everything I could think of. Nothing worked. So, I just deleted the DataGrid
and created a new one, with the same name. Works good now.
- Attachments
-
- CRUD_SQLite_example_v3.5.zip
- (8.89 KiB) Downloaded 1301 times
Re: CRUD SQLite example
That is very odd. I used your CRUD script as a starting point for my script and had the same problem with the datagrid
not working. Sure enough like you mentioned I deleted the grid and re-created it and it works now. If you happen to find
out what the issue was please let me know as I can't figure it out for the life of me. Thanks again for your help!
not working. Sure enough like you mentioned I deleted the grid and re-created it and it works now. If you happen to find
out what the issue was please let me know as I can't figure it out for the life of me. Thanks again for your help!
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392
Re: CRUD SQLite example
Okay-- Here's the updated version, with the dynamic column names.did you update the download on the other post? i would love to download
it once its updated. its really helped me to understand how to do things more.
- Attachments
-
- CRUD_SQLite_example_v3.6.zip
- (9.47 KiB) Downloaded 1306 times
Re: CRUD SQLite example
Hi
please make a presentation on livecode.tv about the sql example stack, it's so grand! Please contact me at bvg AT mac DOT com.
please make a presentation on livecode.tv about the sql example stack, it's so grand! Please contact me at bvg AT mac DOT com.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: CRUD SQLite example
Oooo - I second that - this would make a great presentation for livecode.tv
Re: CRUD SQLite example
Thanks for the encouragement guys!
Yeah-- sure-- I'd be glad to do a presentation for livecode.tv
after I finish at the Summer Academy. (3 weeks left)
There's not much to the example. If I ALSO went over the basics of
the SQL manager, SQLiteMan, then I probably could do 20-30 minutes.
BvG-- I'll send you an email about this. Also, I've been trying to
log into RevOnline for days now. It looks like they're not accepting
uploads right now.
Yeah-- sure-- I'd be glad to do a presentation for livecode.tv
after I finish at the Summer Academy. (3 weeks left)
There's not much to the example. If I ALSO went over the basics of
the SQL manager, SQLiteMan, then I probably could do 20-30 minutes.
BvG-- I'll send you an email about this. Also, I've been trying to
log into RevOnline for days now. It looks like they're not accepting
uploads right now.
Re: CRUD SQLite example
I finally finished this SQlite database example. It's chock full of tight,
good-as-can-be code. I wrote it to be my own personal reference,
but I'm sure other LiveCode beginners will find a lot good code here,
to cut and paste into your own application. Maybe save some time,
instead of trying to figure this stuff out from scratch. I've added new Buttons and Handlers to the main Stack.
AND created a new Sub-Stack called Preferences. This is a single
function called dbData-- that you can use-- to easily save and retrieve
any value in your application, including entire DataGrids. As a single
function, you can simply copy and paste the whole thing into any application.
It's clean, well commented code. Also as is often the case when coding,
we must choose between better efficiency or better readability.
I always opt for better readability and ease of maintenance,
especially in a compiled environment like LiveCode.
good-as-can-be code. I wrote it to be my own personal reference,
but I'm sure other LiveCode beginners will find a lot good code here,
to cut and paste into your own application. Maybe save some time,
instead of trying to figure this stuff out from scratch. I've added new Buttons and Handlers to the main Stack.
AND created a new Sub-Stack called Preferences. This is a single
function called dbData-- that you can use-- to easily save and retrieve
any value in your application, including entire DataGrids. As a single
function, you can simply copy and paste the whole thing into any application.
It's clean, well commented code. Also as is often the case when coding,
we must choose between better efficiency or better readability.
I always opt for better readability and ease of maintenance,
especially in a compiled environment like LiveCode.
- Attachments
-
- CRUD_SQLite_example_v4.3.zip
- (11.26 KiB) Downloaded 2257 times
Re: CRUD SQLite example
Great job! Only problem I see so far is when I try to edit a row and click the update button it says updated but when i refresh the grid the row is not
updated anymore. am i missing something?
also just a silly spelling error but the comment "row in table control updated sussefully" should be successfully of course.
updated anymore. am i missing something?
also just a silly spelling error but the comment "row in table control updated sussefully" should be successfully of course.
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392
Re: CRUD SQLite example
Got that typo corrected-- but the Update Row seems to work okay.
First highlight a Row, then press the Update button.
Refresh, brings it back fine over here.
Anyone else having this problem?
First highlight a Row, then press the Update button.
Refresh, brings it back fine over here.
Anyone else having this problem?
Re: CRUD SQLite example
I found more typos. The name Entry was originally Value, but was changed to
avoid confusion with the SQL keyword VALUE. These are the corrected Usage
Instructions for the dbData function.
avoid confusion with the SQL keyword VALUE. These are the corrected Usage
Instructions for the dbData function.
If you use this stack, just paste them into the Contents of the Display field.This Stack contains a single funcion, which Inserts, Updates,
and Reads rows in a SQLIte file called, System.data.
Usage: dbData (Handle, Entry)
If 'Handle' already exists 'Entry' is Updated instead of Inserted.
Null in 'Handle' closes connection.
Null in 'Entry' returns retrieved Entry.
Successful Inserts & Updates return 'ok'.
Any errors, return details, prefixed with the word, 'ERROR'.
Re: CRUD SQLite example
Thanks Townsend,
useful example -- it's appreciated.
Paul
useful example -- it's appreciated.
Paul
Re: CRUD SQLite example
This weekend I did a short presentation going over this CRUD SQLite Example.
Here's the link to the video: http://dl.dropbox.com/u/35256958/CRUD-Example-video.mp4
(Note: this link should be good until the end of the month. Aug-2011.)
Also here's a minor update.Version 4.4.
Here's the link to the video: http://dl.dropbox.com/u/35256958/CRUD-Example-video.mp4
(Note: this link should be good until the end of the month. Aug-2011.)
Also here's a minor update.Version 4.4.
- Attachments
-
- CRUD_SQLite_example_v4.4.zip
- (11.81 KiB) Downloaded 1775 times
-
BarrySumpter
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: CRUD SQLite example
Nice!
Great work on the video!
And thanks for the update!
Great work on the video!
And thanks for the update!
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: CRUD SQLite example
The video is also available from the livecode.tv site:
http://blog.livecode.tv/2011/08/event-35-wrap-up/
http://blog.livecode.tv/2011/08/event-35-wrap-up/
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

