Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 13 total
Thread Problem with bookmarks
Wed, Jun 30 2010 11:04 PMPermanent Link

Aaron Christiansen

Hi

I am trying to do this:

constructor TRecordPointer.Create(thisTable : TEDBTable);
begin
   rpTable := thisTable;
   rpBookmark :=  thisTable.GetBookmark;

   if not thistable.BookmarkValid(rpBookmark) then
   begin
       beep;
   end;
end;


And I get a beep every time.  I am creating an instance of this class inside a while not .EOF loop, and am 110% sure there is an active record.

Can you see anything obvious with this code that would prevent it from working?

Thanks
Aaron
Thu, Jul 1 2010 2:40 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Aaron

Someone may be far cleverer than  me but I find it an impossible question to answer since it looks as though there is code missing. Is there anything between

> rpBookmark := thisTable.GetBookmark;

and

> if not thistable.BookmarkValid(rpBookmark) then

If not I can't see why its beeping (unless there's a bug in the engine/delphi). If there is then we need to see that code as well. A bookmark can be invalidated for a number of reasons (eg changing index) and you may have one of those present.

Roy Lambert [Team Elevate]
Thu, Jul 1 2010 5:34 AMPermanent Link

Aaron Christiansen

It's exactly as I have pasted - there is no code missing. I have a master-detail setup, but this code fails for both the master and the detail.

Index change will aftter the bookmark validity - I am curious to find out anything else that may impact.

I was considering doing a very simple demo to provide an example, but EDB precludes doing anything simply.
Thu, Jul 1 2010 7:15 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Aaron

>It's exactly as I have pasted - there is no code missing. I have a master-detail setup, but this code fails for both the master and the detail.

If you try and use similar code in or not in a while eof loop, but not in an object's constructor it works - at least here using b14 non-unicode.

There is actually a lot of code missing - starting with TRecordPointer, moving on to the loop, where rpBookmark is defined etc.

>Index change will aftter the bookmark validity - I am curious to find out anything else that may impact.

No idea, I just remember that one; but I would think anything that affects the sequence of the table the bookmark is for.

>I was considering doing a very simple demo to provide an example, but EDB precludes doing anything simply.

Its certainly more of a pain than DBISAM but its not that difficult. Took me all of 5 mins to knock up a quick test. Create something that does show it with the minimum code and tables. Reverse engineer the tables and post that and your project to the binaries. That way the tables aren't needed (unless its a data specific issue) and whoever has a look at it can create their own tables and set the config path as they want.

Roy Lambert [Team Elevate]
Sat, Jul 3 2010 10:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Aaron,

<< I am trying to do this: >>

What version of Delphi/EDB are you using, and how is rpBookmark declared ?

Thanks,

--
Tim Young
Elevate Software
www.elevatesoft.com
Sat, Jul 3 2010 10:15 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Aaron,

<< I was considering doing a very simple demo to provide an example, but EDB
precludes doing anything simply. >>

It's very simple to set up a test application:

1) Drop a TEDBEngine, TEDBSession, TEDBDatabase, and TEDBTable on a form.
2) Alter the TEDBEngine ConfigPath so it points to your configuration path.
3) Set the TEDBSession LoginUser, LoginPassword, and SessionName (I use
'Test') properties.
4) Set the TEDBDatabase SessionName property to the same as the TEDBSession
component, and set the DatabaseName property (I use 'TestDB').  Select the
desired EDB database for the Database property.
5) Set the TEDBTable SessionName property to the same as the TEDBSession
component, and set the DatabaseName property to the same as the TEDBDatabase
component.  Select the desired EDB table for the TableName property.

--
Tim Young
Elevate Software
www.elevatesoft.com


Mon, Jul 5 2010 12:08 AMPermanent Link

Aaron Christiansen


> There is actually a lot of code missing - starting with TRecordPointer, moving on to the loop, where rpBookmark is > defined etc.

In the context of your post "is there anything between X and Y - no - there is nothing (missing) between X and Y.

Clearly there is an entire application's worth of code missing, I really did not think you meant : was I trying to compile that one procedure as an application in its own right.

I know you're trying to help but the communication is problematic.
Mon, Jul 5 2010 12:13 AMPermanent Link

Aaron Christiansen

"Tim Young [Elevate Software]" wrote:

Aaron,

<< I am trying to do this: >>

What version of Delphi/EDB are you using, and how is rpBookmark declared ?

Thanks,
------------------------------------------------------------------------------------------------------------------------------------------------------------------

Delphi 2010
EDB engine 2.03 build 12

   TRecordPointer = class
       private
           rpTable : TEDBTable;        // where the record originated
           rpBookmark : TBookmark;     // to instantly re-locate the corresponding record
       published
           constructor Create(thisTable : TEDBTable);
           destructor Destroy;  override;
           procedure locate;
   end;


PS: having used online forums for the last few years, this one seems underpowered. Preview, proper quoting, and edit are all very common functions missing.
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Mon, Jul 5 2010 1:02 AMPermanent Link

Aaron Christiansen

Problem solved:

I was using this code to provide pointers to records in a visual control. As previously discussed, SomeTable.DisableControls means your UI does not scroll wildly as you build the visual control. It also disables master-detail links, so is not useful in the master-detail scenario.

I read somewhere you can use a non-zero BlockReadSize value instead, and had done so, to good effect.

BUT it would appear this prevents GetBookmark from working properly, returning nil.

I removed the BlockReadSize change code and the generated bookmark was not nil, ie was valid.
Mon, Jul 5 2010 4:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Aaron


>PS: having used online forums for the last few years, this one seems underpowered. Preview, proper quoting, and edit are all very common functions missing.

Also using a number of on-line and off-line forums I can say that ElevateSoft's solution is a joy to use off-line and very acceptable on-line. By comparison Embarcadero's (my other main one) with all the wonderful features is far less enjoyable. The web only solutions are generally non very useful.

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image