Solved

saving bookmark when table closes

Posted on 1998-05-19
12
180 Views
Last Modified: 2010-08-05
How can I save a bookmark when the table closes, it seems to wipe out?  I am using TBookMarkStr with D3. Thanks, tom.
 
0
Comment
Question by:tomcorcoran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 1

Expert Comment

by:Greedy
ID: 1346339
What database system?
0
 

Expert Comment

by:jhunt
ID: 1346340
TBookmark is a Pointer type to a internal list witch keeps track of the record youre pointing on. When you close a table and reopen it the internal list will be createted, but at a different memory location. This wil make your saved bookmarkpointer useles.
Try this:
Make sure your table has a primary unique index and save the field value from that unique index. Next time your table opens you can perform a gotokey to go to the position you have saved.
0
 

Author Comment

by:tomcorcoran
ID: 1346341
We are using paradox. Greedy, thanks for the information, I'm not sure that this method can work as the user can select the database (and chanhe the index) at run-time. Maybe I could used the Indexdef property to find the primary index fields?

Thanks, Tom.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:jhunt
ID: 1346342
Dear Tom,
In every good table design there should be 1 unique field in eacht table, mostly of the type autoincrement. My solution suggested placing code in the beforeclose event of the ttable. From every table you should know with field is the unique key field. An as the code is executed everytime for each table it should not be that difficult to save the primary key !

John
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1346343
If your useing Parodox you HAVE to have a primary key for the Table.  I'm curious why you whould want to open a table then close it then open it again?
0
 

Expert Comment

by:jhunt
ID: 1346344
Dear Tom,
if you are saving from tables with unknown structures you can iterate the indexes to find out the primary key:

to find all indexes use the GetIndexNames procedure with fills the tstrings. Then you can loop thou that list and with the
Indexproperty (TStrings.Items[loopcount], idUnique) you can find the primary index.
Finally the bde function DBIGetIndexDesc can give you the the field from the primary key.

John
0
 

Author Comment

by:tomcorcoran
ID: 1346345
Allright guys. JHunt, you are describing an ideal situation which I have never seen existing in a large maintained system. It's a database utlity, the user can open any one of about 100 tables, all with primary indexes from 0 to 3 fields. To satisfy your curiousity Greedy, in order to use Tutil32 to verify/repair tables the database must be closed - so I temporarily close and then reopen but don't want to loose the record the user was on. Thanks, Tom.
0
 

Author Comment

by:tomcorcoran
ID: 1346346
PS. Greedy, you do no have to have a primary key with paradox.
0
 

Author Comment

by:tomcorcoran
ID: 1346347
Greedy, FYI, you do not have to have a primary index in paradox.
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1346348
Your right...I was thinking Access, sorry.  One thing you can do with Paradox is Table1.RecNo and map that to an int and then to get back to the record do this:

  Table1.DisableControls;
  Table1.First;
  For I := 1 to MyOldPos - 1 do
    Table1.Next;
  Table1.EnableControls;

You won't be able to use it for multipul users.  But it might work for what your doing.


0
 

Author Comment

by:tomcorcoran
ID: 1346349
Greedy, that worked great, thanks a million. Please post dummy answer so I can grade.  Tom.
0
 
LVL 1

Accepted Solution

by:
Greedy earned 50 total points
ID: 1346350
No problem, glad to help...
see comments for answer.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question