Bookmarks - access violations on imporper use

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek

Bookmarks - access violations on imporper use

Post by Ludek » Tue 25 Oct 2005 11:03

Sometimes, If I call GetBookmark, close the query, reopen the query and call BookmarkValid on this bookmark, I get an access violation. On some machines the program even crashes without any message.
Are you able to simply return "false" under this condition? It did work without any problems with BDE.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 27 Oct 2005 06:23

> Are you able to simply return "false" under this condition?

It's quite difficult. After closing dataset bookmarks are not valid. Use key fields instead.

Guest

Ludek Stauber

Post by Guest » Wed 02 Nov 2005 13:55

Do you mean the ProviderFlags.pfInKey? Or something else?
Is there a convenient way to store the value of all this keys to a variable and to jump to their position after? Like using TBookmark: GetBookmark, GotoBookmark, FreeBookmark? Or do I have to program it myself - iterate over fields, check this flag, store to a variant array and then Locate?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 02 Nov 2005 15:40

Currently SDAC does not provide automation for Close..Open sequence.
To perform this task use Refresh instead of Close..Open.

Post Reply