Database - Field properties - Refresh fields

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
glenn52
Posts: 25
Joined: Mon May 02, 2011 1:34 pm
Contact:

Database - Field properties - Refresh fields

Post by glenn52 » Fri Jun 03, 2011 8:47 am

I have on a card a field "DateOfBirth" and one "Age".
These are linked (properties) to a query and column in the database.
Following calculation of Age, my 'view' of the Age field is fine.
The database is updated.
However if I move to another record and back I see the original data in the fields.
The fields are not updated until I leave the card and return to it.
Whilst I understand this, is there a way of refreshing the card view, and hence field properties?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Database - Field properties - Refresh fields

Post by Mark » Fri Jun 03, 2011 10:59 am

Glenn,

Not enough info, don't understand, am confused by your question.

You go to a different card and back to see the updated field, yet the field is not updated?!

How do you link (properties) to queries and columns?

What triggers the update of the database?

When exactly do you expect your field to be updated? Since you are typing the info into the field and the database is actually updated, the old data doesn't exist anymore. Where does the old data come from?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Database - Field properties - Refresh fields

Post by bangkok » Fri Jun 03, 2011 12:40 pm

I think you are using the "Database query builder", right ?

If you do, then... you don't. :) It has been discontinued.

glenn52
Posts: 25
Joined: Mon May 02, 2011 1:34 pm
Contact:

Re: Database - Field properties - Refresh fields

Post by glenn52 » Sun Jun 05, 2011 1:19 am

Mark:
You go to a different card and back to see the updated field, yet the field is not updated?!
Correct.

How do you link (properties) to queries and columns?
Create a database query and set the Database properties of the field. See link below.

What triggers the update of the database?
UPDATE query, and using my SQLite manager I can see the database is updated immediately the query is run.

When exactly do you expect your field to be updated? Since you are typing the info into the field and the database is actually updated, the old data doesn't exist anymore. Where does the old data come from?
The database is updated but the card has not 're-queried' the database. The database properties apparently only get refreshed preOpen or onOpen, and this should happen on the database update.

Bangkok:
I think you are using the "Database query builder", right ?
The Database Query Builder was used to build the SELECT query for the field database properties.

If you do, then... you don't. :) It has been discontinued.
The Database Query Builder is alive and well in my LC 4.6.1. The Database Query Builder is a component of LC, documented and a valid and handy tool for simple SELECT queries.

"Creates or edits settings for using an SQL database. Using the
Database Query Builder, you can connect to a database and
specify a SQL query to generate a cursor result set. Connection
settings and cursor result sets can be linked to fields for display
of the data, using the Database pane in the field's property
Inspector. For more details, see the section on Working with
Databases.
"

http://lessons.runrev.com/spaces/lesson ... ry-Builder

glenn52

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Database - Field properties - Refresh fields

Post by Mark » Sun Jun 05, 2011 1:26 am

Glenn,

I always had trouble with the database query builder and I have always been scripting databases by hand. Apparently, I wasn't the only one, since it has indeed been discontinued. The stack is included in the current LC package for compatibility reasons only. It is not recommended to use it. Mentions of the query builder in the documentation are relics of the past.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply