Forum > Databases

Get rid of DBNavigator ...

(1/1)

1HuntnMan:
I have a previous post with a conflict between DBNav and a JvDBLookUpCombo.
Anyway, thought I'd try another strategy and found this in the Lazarus Tdbf Tutorial.  See code below.  This doesn't work if I attempt to enter and place a SpeedBtn on the panel and onclick event Dbf Proposals.DataSet.First(); . Laz won't even recognize this??? Just testing to cure the other post I made about the JvDBLookUpCombo disappearing value by creating a Nav without using the DBNavigator.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Moving Thru Table Records(Jumping to Beginning of File, End of File, Next Record, Prior Record, etc.)DbfContacts.FilePathFull := '/home/somelocation/database_location/';   // Path to        the database directoryDbfContacts.TableName := 'Contacts.dbf;    // database file (including extension)DbFContacts.Open;DbfContacts.DataSet.First();   // -> Go to the first recordDbfContacts.DataSet.Prior();  // -> Go to the previous recordDbfContacts.DataSet.Next();  //->  Go to the next recordDbfContacts.DataSet.Last();  //->  Go to the last recordDbfContacts.DataSet.BOF;  { Is the cursor at the beginning of the data                                     (on the first record) , returns boolean }DbfContacts.DataSet.EOF;  //->  Is the cursor at the end of the data                                     (on the last record) 

cdbc:
Hi
Skip the '.DataSet' in 'DbfContacts.DataSet.First();'. "DbfContacts" *is* the /dataset/  8)
Regards Benny

egsuh:

--- Quote ---Skip the '.DataSet' in 'DbfContacts.DataSet.First();'. "DbfContacts" *is* the /dataset/
--- End quote ---

I agree. Your codes should work.

1HuntnMan:
Yup, leave out the DataSet, just DbfContacts.First(), DbfContacts.Prior(), DbfContacts.Last(), etc.

Thanks, the Lazarus TDbf Tutorial is wrong in their examples, see below:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Moving Thru Table Records(Jumping to Beginning of File, End of File, Next Record, Prior Record, etc.)DbfContacts.FilePathFull := '/home/somelocation/database_location/';   // Path to        the database directoryDbfContacts.TableName := 'Contacts.dbf;    // database file (including extension)DbFContacts.Open;DbfContacts.DataSet.First();   // -> Go to the first recordDbfContacts.DataSet.Prior();  // -> Go to the previous recordDbfContacts.DataSet.Next();  //->  Go to the next recordDbfContacts.DataSet.Last();  //->  Go to the last recordDbfContacts.DataSet.BOF;  { Is the cursor at the beginning of the data                                     (on the first record) , returns boolean }DbfContacts.DataSet.EOF;  //->  Is the cursor at the end of the data                                     (on the last record) 

Navigation

[0] Message Index

Go to full version