Browse Source

* fcl-db: set blob field type for blob fields in SetDataType; fixes mantis issue #26064

git-svn-id: trunk@27645 -
reiniero 11 years ago
parent
commit
7702488182
2 changed files with 11 additions and 6 deletions
  1. 2 1
      packages/fcl-db/src/base/db.pas
  2. 9 5
      packages/fcl-db/src/base/fields.inc

+ 2 - 1
packages/fcl-db/src/base/db.pas

@@ -368,7 +368,7 @@ type
     procedure SetAsString(const AValue: string); virtual;
     procedure SetAsWideString(const AValue: WideString); virtual;
     procedure SetDataset(AValue : TDataset); virtual;
-    procedure SetDataType(AValue: TFieldType);
+    procedure SetDataType(AValue: TFieldType); virtual;
     procedure SetNewValue(const AValue: Variant);
     procedure SetSize(AValue: Integer); virtual;
     procedure SetParentComponent(AParent: TComponent); override;
@@ -880,6 +880,7 @@ type
     procedure GetText(var TheText: string; ADisplayText: Boolean); override;
     procedure SetAsBytes(const AValue: TBytes); override;
     procedure SetAsString(const AValue: string); override;
+    procedure SetDataType(AValue: TFieldType); override;
     procedure SetText(const AValue: string); override;
     procedure SetVarValue(const AValue: Variant); override;
     procedure SetAsWideString(const AValue: WideString); override;

+ 9 - 5
packages/fcl-db/src/base/fields.inc

@@ -805,13 +805,11 @@ end;
 
 
 procedure TField.SetAsLongint(AValue: Longint);
-
 begin
   SetAsInteger(AValue);
 end;
 
 procedure TField.SetAsInteger(AValue: Longint);
-
 begin
   raise AccessError(SInteger);
 end;
@@ -822,7 +820,6 @@ begin
 end;
 
 procedure TField.SetAsString(const AValue: string);
-
 begin
   Raise AccessError(SString);
 end;
@@ -1915,7 +1912,7 @@ constructor TFloatField.Create(AOwner: TComponent);
 
 begin
   Inherited Create(AOwner);
-  SetDatatype(ftfloat);
+  SetDatatype(ftFloat);
   FPrecision:=15;
   FValidChars := [DecimalSeparator, '+', '-', '0'..'9', 'E', 'e'];
 end;
@@ -2386,7 +2383,7 @@ constructor TVarBytesField.Create(AOwner: TComponent);
 
 begin
   INherited Create(AOwner);
-  SetDataType(ftvarbytes);
+  SetDataType(ftVarBytes);
   Size:=16;
 end;
 
@@ -2897,6 +2894,13 @@ begin
     end;
 end;
 
+procedure TBlobField.SetDataType(AValue: TFieldType);
+begin
+  inherited SetDataType(AValue);
+  If AValue in [Low(TBlobType)..High(TBlobType)] then
+    FBlobType := AValue;
+end;
+
 
 procedure TBlobField.SetAsWideString(const AValue: WideString);
 var