How to use database linked controls

Jan Schenkel janschenkel at yahoo.com
Fri Jul 23 07:14:03 EDT 2004


--- Bill <bill at bluewatermaritime.com> wrote:
> Jan:
> 
> How do you get the   --
> revRecordCountOfQuery(somevariable)
> To work? (I tried inserting all kinds of things in
> the somevariable and got
> nothing).
> 

The parameter is the name of a query ; for example :
  get revRecordCountOfQuery("Connect")

> I want to have my various changes of the query using
>  revSetSQLOfQuery "Connect",tSQLStatement to also
> put the subset of the
> records found in a field. I would also like the
> arrow commands that go
> through the records found to show a which record
> they are at related to the
> total records found.
> 

As Andre suggested, you can use a table field to show
a list of records (and either show all or a subset of
their columns).

If you want to show other fields of these records only
as the uses goes through the list using the arrow
keys, then the next rick should come in handy.

Copy the query and name it "Connect 2"

Next, add some more fields to show the columns of
individual records, and hook them up to query "Connect
2".

Now set the field script to something like :
--
on selectionChanged
  put the hilitedLine of me into tLine
  if tLine is empty then exit selectionChanged
  put the number of lines of me into tTotal
  put tLine && "/" && tTotal into field
"CurrentRecord"
  revGoToRecordOfQuery "Connect 2",tLine
end selectionChanged
--

As the user steps through the table field, the
individual record fields will be autmagically updated.

Of course you'll have to update both of the queries
with your new SQL query, but that should be a breeze. 
(*)

> Should I be using the 2.5beta for my testing? If so
> I don't know where to
> down load it as I never got the email about it.
> 
> Bill
> 

This should work in 2.2 for queries which have 'Cache
record set' checked -- others may experience problems
for some ODBC-connected databases.  (infinite loop
fixed for 2.5b1)
Actually, I suggest that you always turn on the 'Cache
record set' option if you may change the data in the
database.

I hope this helped,

Jan Schenkel.

(*) Actually, I tried doing it with one query, but you
get refresh problems.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 


More information about the use-livecode mailing list