Browse Source

+ RecNo should be -1 if the recordset is empty

git-svn-id: trunk@3415 -
joost 19 years ago
parent
commit
49b6e35862
1 changed files with 3 additions and 2 deletions
  1. 3 2
      fcl/db/bufdataset.inc

+ 3 - 2
fcl/db/bufdataset.inc

@@ -633,9 +633,10 @@ Var SearchRecBuffer : PBufRecLinkItem;
 
 begin
   abuf := ActiveBuffer;
-  if assigned(abuf) then
+  // If abuf isn't assigned, the recordset probably isn't opened.
+  if assigned(abuf) and (FRecordCount>0) then
     begin
-    GetBookmarkData(ActiveBuffer,@SearchRecBuffer);
+    GetBookmarkData(abuf,@SearchRecBuffer);
     TmpRecBuffer := FFirstRecBuf;
     recnr := 1;
     while TmpRecBuffer <> SearchRecBuffer do