Problems with Bookmark

Problems with Bookmark

Post by Ove » Thu, 19 Jun 2008 16:39:15


Hi everybody!

When I set a bookmark in an ADOtable I cant go back to that place later.
This is my code


procedure TForm3.DBG1CellClick(Column: TColumn); //DBG1 is a TDBGrid
begin
BM:=DM1.TblEl.GetBookmark; //Bookmark to the record I clicked.

DM1.TblEl.First;
DecodeDate(DM1.TblEl.Fields[1].AsDateTime,Ar,Mon,dag); //date of first
record in table
Ars:=Ar;
DM1.TblEl.GotoBookMark(BM); //Back to Bookmark

DecodeDate(DM1.TblEl.Fields[1].AsDateTime,Ar,Mon,dag); //This reads the
last record in the table?? Why??
.
.
.

I guess I am doing something wrong or there is a setting I have missed.

Very thankful for help about this.

Greetings
/Ove
 
 
 

Problems with Bookmark

Post by Ove » Sun, 22 Jun 2008 22:18:20

Hallo Brian!
Thanks for your answer but it doesn't make any differens.

Something is very strange here.

If I delete my Bookmarks and use this code instead

procedure TForm3.DBG1CellClick(Column: TColumn); //DBG1 is a TDBGrid
begin
DecodeDate(DM1.TblEl.Fields[1].AsDateTime,Ar,Mon,dag); //The clicked
record in the DBGrid is selected. Ar, mon, dag is from the last record in
the table and not from the record I click in the DBGrid??


I guess there is a setting in the ADOConnection or The Datasource or the
table in the DataModule DM1 that I have changed and now cant find the way
back to.

Best regards
/Ove


"Brian Bushay TeamB" < XXXX@XXXXX.COM > skrev i meddelandet

 
 
 

Problems with Bookmark

Post by Ove » Mon, 23 Jun 2008 17:01:31

Yes?
it is the records from TblEl that the grid shows. There is no other table
with that kind of content.

I use Microsoft Access database with a datafil El1.mdb

My ConnectionString is
DM1.ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=' + datafil + ';Mode=Read|Write;Persist Security Info=False';

and datafil:='C:\Documents And Settings\All Users\Dokument\SPEDA
\El\El1.mdb'
which is the right place.

/Ove

"Brian Bushay TeamB" < XXXX@XXXXX.COM > skrev i meddelandet
 
 
 

Problems with Bookmark

Post by Ove » Tue, 24 Jun 2008 03:23:51

ound the solution!

I checked out what forms I have in my project and found 2 Datamodules both
named DM1 (which I didn't think was possible and what I not have done
myself). Removed both and then installed one of them again and everything
works as expected even with the bookmarks.

Thanks and best Regards
Ove!

"Ove" < XXXX@XXXXX.COM > skrev i meddelandet
news:485e06d6$ XXXX@XXXXX.COM ...