Browse Source

+ Added check to TParam.SetDataType for empty variants

git-svn-id: trunk@3549 -
joost 19 years ago
parent
commit
558470b406
1 changed files with 8 additions and 6 deletions
  1. 8 6
      fcl/db/dsparams.inc

+ 8 - 6
fcl/db/dsparams.inc

@@ -633,11 +633,14 @@ begin
   If (VT=varError) then
     clear
   else
-    Try
-      FValue:=VarAsType(FValue,VT)
-    except
-      Clear;
-    end;
+    if not VarIsEmpty(FValue) then
+      begin
+      Try
+        FValue:=VarAsType(FValue,VT)
+      except
+        Clear;
+      end { try }
+      end;
 end;
 
 Procedure TParam.SetText(const AValue: string);
@@ -764,7 +767,6 @@ Procedure TParam.AssignFieldValue(Field: TField; const AValue: Variant);
 begin
   If Assigned(Field) then
     begin
-    // Need TField.FixedChar property.
     if (Field.DataType = ftString) and TStringField(Field).FixedChar then
       DataType:=ftFixedChar
     else if (Field.DataType = ftMemo) and (Field.Size > 255) then