CRUD SQLite example
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: CRUD SQLite example
THX for the help. However I'm still not sure where the references to iHandle and iEnter come from any ideas?
Jeff G potts
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: CRUD SQLite example
function dbData iHandle, iEntry
They are the paramaters passed when calling this dbData function.
Do a search in the LC IDE Script Editor for dbData searching the entire stack.
You'll find where the call are being made and where the iHandle and iEntry is being assigned
by search for iHandle and iEntry in that tab.
If I had to guess iHandle would be the handle to the openDatabase and iEntry would be the key to that record.
hth
They are the paramaters passed when calling this dbData function.
Do a search in the LC IDE Script Editor for dbData searching the entire stack.
You'll find where the call are being made and where the iHandle and iEntry is being assigned
by search for iHandle and iEntry in that tab.
If I had to guess iHandle would be the handle to the openDatabase and iEntry would be the key to that record.
hth
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
When I try to "Update Row in DB" via the button, I get an answer of "0" so it is not completing the doUpdateRow command.
-
- Posts: 14
- Joined: Thu Apr 19, 2012 9:29 am
Re: CRUD SQLite example
i was just looking for a complete sql sample and your code comes closet to that many thanks that you share it.
Just one question how do you add a new record? when I select the pop up form it comes with a error message.
Thanks
Hans
Just one question how do you add a new record? when I select the pop up form it comes with a error message.
Thanks
Hans
Re: CRUD SQLite example
I've updated my CRUD SQLite example to LC 7.1. Here are some of the changes.
** Code for each operation is now within each button, not is the stack script.
** The actual name of the db file is controlled by 1 field in the stack script.
** dgHilitedIndex is used instead of dgHilitedline, as it is always an index that is returned.
** The one-function-does-everything, dbHandle has been removed, and will be updated separately.
** In 'Read Into db Into DataGrid", the dataGrid is updated one line at a time instead of all at once.
** Code for each operation is now within each button, not is the stack script.
** The actual name of the db file is controlled by 1 field in the stack script.
** dgHilitedIndex is used instead of dgHilitedline, as it is always an index that is returned.
** The one-function-does-everything, dbHandle has been removed, and will be updated separately.
** In 'Read Into db Into DataGrid", the dataGrid is updated one line at a time instead of all at once.
Re: CRUD SQLite example
Thank you, Paul Townsend. Much appreciated.
Re: CRUD SQLite example
Hello,
I'm trying to learn data grid using CRUD SQLITE example as a test application. The populate data group routine runs to completion with no errors, but no data is displayed on the grid. Wonder what''s going on. The following command appears to be what moves data to the grid. What is AddLine? I can't find any reference to it in the documentation.
dispatch "AddLine" to grp "myGrid" with temp
Need help. Thanks.
I'm trying to learn data grid using CRUD SQLITE example as a test application. The populate data group routine runs to completion with no errors, but no data is displayed on the grid. Wonder what''s going on. The following command appears to be what moves data to the grid. What is AddLine? I can't find any reference to it in the documentation.
dispatch "AddLine" to grp "myGrid" with temp
Need help. Thanks.
Re: CRUD SQLite example
I got it to work replacing the repeat loop (it's the Read db into Datagrid I was referring to).
repeat with ii = 1 to fld "rCounter"
put line ii of dlist into temp
dispatch "AddLine" to grp "myGrid" with temp
end repeat
with the statement:
set the dgText of group "myGrid" to ptext
What would I be missing by replacing the repeat loop with the statement above?
repeat with ii = 1 to fld "rCounter"
put line ii of dlist into temp
dispatch "AddLine" to grp "myGrid" with temp
end repeat
with the statement:
set the dgText of group "myGrid" to ptext
What would I be missing by replacing the repeat loop with the statement above?
Re: CRUD SQLite example
Excellent point Resty!
For code in the button, Read db into Datagrid...
Replace these lines:
For code in the button, Read db into Datagrid...
Replace these lines:
With the statement:repeat with ii = 1 to fld "rCounter"
put line ii of dlist into temp
dispatch "AddLine" to grp "myGrid" with temp
end repeat
Much faster!! Much better!set the dgText of group "myGrid" to ptext
Re: CRUD SQLite example
Hm. Did someone hack into townsend's account?
Re: CRUD SQLite example
Yes. It's me! These days, I only have one application that still uses LiveCode. It's a web scraping application that I developed for my personal use. Also, I have become fairly proficient with two other development platforms. Above all, I always on the lookout for new technologies that will give me an edge in the marketplace.
BUT!!! Now with the advent of this LiveCloud.io offering, I see BIG opportunities ahead.
So... I'm back, actively coding in LiveCode again.
BUT!!! Now with the advent of this LiveCloud.io offering, I see BIG opportunities ahead.
So... I'm back, actively coding in LiveCode again.
Re: CRUD SQLite example
I am looking at the SQLite opening it with LC 8.1.6.
Looking at the scripts for the buttons no problem
When opening the same stack in LC ver 9.0.4 I am unable to open any button script.
It is as if I cannot go into edit mode.
What could be the reason for this?
Looking at the scripts for the buttons no problem
When opening the same stack in LC ver 9.0.4 I am unable to open any button script.
It is as if I cannot go into edit mode.
What could be the reason for this?
Last edited by PeterG on Tue May 28, 2019 8:55 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 9960
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: CRUD SQLite example
Welcome back.
While you were gone the engine team added the ability to specify sockets for UDP, so the lack of that which had brought this old P2P thread to a dead end had since been resolved:
viewtopic.php?f=11&t=18594&p=94376#p94376
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: CRUD SQLite example
is debugging turned on in the Development menu?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com