How to use database-linked controls
Bill
bill at bluewatermaritime.com
Thu Jun 24 22:05:06 EDT 2004
On 6/24/04 7:36 PM, "use-revolution-request at lists.runrev.com"
<use-revolution-request at lists.runrev.com> wrote:
> You can only pick a format when the "Update after
> editing" button is checked.
> What was in the failed query? The only thing I can
> think of right away is that you didn't set the primary
> key in the query builder.
The primary key is set (there is a nice informative error which tells you to
set the primary key when you forget) and the field I was trying to update
has "the update after editing" button checked. I would want all 64 of the
fields to use this feature but I am only testing a couple of the fields now.
I tested the exact same query manually and it worked perfectly.
Error message is: "Update failed on the SQL command: UPDATE voyages SET
v_arrival_draft =:1 WHERE voyageID= '150-03-001'
Revdb error:
(then nothing more)
The manual SQL command that works is exactly the same except I replace the
cryptic ":1" as above with the actual draft of the ship: "19.3' ". I imagine
that ":1" is some kind of variable.
> While it is entirely possible to start from scratch,
> and this will give you full control ovr every aspect
> of the SQL -- but don't completely ignore the
> database-linked fields, as they give you a quick
> method to hook a series of fields up to a database.
I agree. This is a truly great time saver and I will keep trying to use it
especially now that I am getting such informative answers to help in trouble
shooting. I also need to know how to insert a variable into the Database
Query Builder so that the record set returned will be dependent on a where
clause that includes that variable. When you experiment with putting a
variable in there it goes into an annoying loop telling you that there is no
such column name. It is difficult to try different things because of the
error loop. Perhaps the variable needs to be in quotes or identified
somehow.
How do I get the database ID thot the automatic database-linked query gets
(which I set to on open card) because if I can grab that I can avoid making
a new connection in the manual queries I am making (I tried left joins in
the Database Query Builder and they didn't work) -- the combination of
manual queries and the database-linked fields seems to be the best solution
if I can get the update feature to work.
>
> As the current maintainer of the database-linked
> controls, I'm open to suggestions on how to expand and
> enhance what is there.
More information about the use-livecode
mailing list