Board index » cppbuilder » Posting a record and current record placement.

Posting a record and current record placement.

Hiya,

Okay, I'm working on a functionality request for a database app.  The
problem is when they post a record, they want that posted record to just
stay on the DB grid wherever they posted it.  So if they were selected
in the middle of the grid somewhere and pushed the "new" button to start
editing a new record, and then post it, the posted record would not only
be selected, but the grid would not re-sort or necessarily refresh.  So
far I am only able to refresh it, or not refresh it and when I do not
refresh it the record that they post dissapears!  Are there some options
or some common code I could use to produce the desired behavior?

R/S Aaron Rhodes

 

Re:Posting a record and current record placement.


The only way that I can think of is to reorder the database or
the order that the records a retrieved. If it's a small DB you
could most likely reorder it using a trigger or stored proc but
this presents all kinds of problems - especially if it is a
multi-user DB.

If it is a multi-user DB, the only way not to affect the other
users is to change the order that the records a retrieved. I
think that you could do it using a join but this too has
problems when the user starts to insert multiple records.

One insert would mean a join with all records above the new
record, the new record, and then the records below the new
record. Then you'd have to maintain the sql for the join and
keep adding to it each time the user inserted a record. This
wouldn't be too bad if all the inserts happened in the same
place but you know that won't be the case.

If you find a solution, come back and post it. I for one would like to see it.

Good Luck

~ JD

Quote
Aaron Rhodes <rhode...@llnl.gov> wrote:
>Hiya,

>Okay, I'm working on a functionality request for a database app.  The
>problem is when they post a record, they want that posted record to just
>stay on the DB grid wherever they posted it.  So if they were selected
>in the middle of the grid somewhere and pushed the "new" button to start
>editing a new record, and then post it, the posted record would not only
>be selected, but the grid would not re-sort or necessarily refresh.  So
>far I am only able to refresh it, or not refresh it and when I do not
>refresh it the record that they post dissapears!  Are there some options
>or some common code I could use to produce the desired behavior?

>R/S Aaron Rhodes

Other Threads