Solved

saving bookmark when table closes

Posted on 1998-05-19
12
181 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

631 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