Browse Source

* fcl-db: tdbf: detect some files as DBaseIV instead of III given version signature $03,$8B regardless of language ID. Mantis issue #26332

git-svn-id: trunk@27993 -
reiniero 11 years ago
parent
commit
39ae91a66f
1 changed files with 5 additions and 4 deletions
  1. 5 4
      packages/fcl-db/src/dbase/dbf_dbffile.pas

+ 5 - 4
packages/fcl-db/src/dbase/dbf_dbffile.pas

@@ -380,7 +380,7 @@ var
 
 
     version := PDbfHdr(Header)^.VerDBF;
     version := PDbfHdr(Header)^.VerDBF;
     FDbfVersion := xUnknown;
     FDbfVersion := xUnknown;
-    // Some hardcode versions for Visual FoxPro; see MS documentation
+    // Some hardcoded versions for Visual FoxPro; see MS documentation
     // (including the correction at the bottom):
     // (including the correction at the bottom):
     // http://msdn.microsoft.com/en-US/library/st4a0s68%28v=vs.80%29.aspx
     // http://msdn.microsoft.com/en-US/library/st4a0s68%28v=vs.80%29.aspx
     case version of
     case version of
@@ -389,14 +389,15 @@ var
     end;
     end;
     if FDbfVersion = xUnknown then
     if FDbfVersion = xUnknown then
       case (version and $07) of
       case (version and $07) of
-        $03: //dbf without memo. Could be foxpro, too
-          if LanguageID = 0 then
+        $03: //dbf with/without memo. Could be Foxpro, too
+          if not(version in [$03,$8B]) {dbase IV, even with cleared language ID} and
+            (LanguageID = 0) then
             FDbfVersion := xBaseIII
             FDbfVersion := xBaseIII
           else
           else
             FDbfVersion := xBaseIV;
             FDbfVersion := xBaseIV;
         $04:
         $04:
           FDbfVersion := xBaseVII;
           FDbfVersion := xBaseVII;
-        $02 {FoxBase, not readable by current Visual FoxPro driver}, $05:
+        $02 {FoxBase, not readable by current MS Visual FoxPro driver}, $05:
           FDbfVersion := xFoxPro;
           FDbfVersion := xFoxPro;
       else
       else
         begin
         begin