Board index » delphi » Moving current record to match row in SQL result table row

Moving current record to match row in SQL result table row

Delphi 3.02 and MS Access 95

Can anyone answer this query?

How do I move the current record in a table to match

the same row which has been displayed in a table created

as a result of a SQL query.  The idea is that the user will

carry out a SQL query which will result in a number of records

being displayed using a DBGrid (with a reduced set of table fields)

When the user clicks on a particular row in the SQL generated table,  

all the fields of that row will be displayed on a Delphi Form which will

represent the way the record was originally entered. It's not as crazy

as it sounds ---- honest!

I think BookMarks, MyTable.GotoBookMarks and SelectedRows will feature in the

answer but I do'nt know how it's done.

Any help with this would be very welcome!

Steve Fowler

s.fow...@qub.ac.uk

 

Re:Moving current record to match row in SQL result table row


Quote
>When the user clicks on a particular row in the SQL generated table,

>all the fields of that row will be displayed on a Delphi Form which will

>represent the way the record was originally entered. It's not as crazy

>as it sounds ---- honest!

No, thats fairly standard behaviour :-)

When your user clicks on the table, the fields of your Query-Objects contain
the values you want to display. Just use them, no need to do anything
special.

Peter

Re:Moving current record to match row in SQL result table row


When the user clicks on the row in the DBGrid, that row then becomes the active
row in the underlying dataset...  You should just need to do something like the
following the get the data:

ShowMessage(Query1.FieldByName('MyField').Value);

--
-Adam
Delphi Developer Support

Due to my workload, personal email more than likely won't get a
reply.

Support options are detailed at http://www.inprise.com/devsupport/
I am unable to answer support questions via email at this time.

Quote
s.fow...@qub.ac.uk wrote:
> Delphi 3.02 and MS Access 95

> Can anyone answer this query?

> How do I move the current record in a table to match

> the same row which has been displayed in a table created

> as a result of a SQL query.  The idea is that the user will

> carry out a SQL query which will result in a number of records

> being displayed using a DBGrid (with a reduced set of table fields)

> When the user clicks on a particular row in the SQL generated table,

> all the fields of that row will be displayed on a Delphi Form which will

> represent the way the record was originally entered. It's not as crazy

> as it sounds ---- honest!

> I think BookMarks, MyTable.GotoBookMarks and SelectedRows will feature in the

> answer but I do'nt know how it's done.

> Any help with this would be very welcome!

> Steve Fowler

> s.fow...@qub.ac.uk

Re:Moving current record to match row in SQL result table row


Just use a findkey in the tTable based on the current query record.  Should
bevery simple.

Arrow Software

Quote
s.fow...@qub.ac.uk wrote in message <7bp7j4$3q...@news.qub.ac.uk>...
>Delphi 3.02 and MS Access 95

>Can anyone answer this query?

>How do I move the current record in a table to match

>the same row which has been displayed in a table created

>as a result of a SQL query.  The idea is that the user will

>carry out a SQL query which will result in a number of records

>being displayed using a DBGrid (with a reduced set of table fields)

>When the user clicks on a particular row in the SQL generated table,

>all the fields of that row will be displayed on a Delphi Form which will

>represent the way the record was originally entered. It's not as crazy

>as it sounds ---- honest!

>I think BookMarks, MyTable.GotoBookMarks and SelectedRows will feature in
the

>answer but I do'nt know how it's done.

>Any help with this would be very welcome!

>Steve Fowler

>s.fow...@qub.ac.uk

Other Threads