Browse Source

* Patch from Luiz Americo to set TStringField.Size:=dsMaxStringSize

git-svn-id: trunk@9250 -
joost 18 years ago
parent
commit
465b41fbfd

+ 4 - 1
packages/fcl-db/src/sqlite/sqlite3ds.pas

@@ -169,7 +169,10 @@ begin
    begin
    begin
      AType := ftString;
      AType := ftString;
    end;
    end;
-   FieldDefs.Add(StrPas(sqlite3_column_name(vm,i)), AType, 0, False);
+   if AType = ftString then
+     FieldDefs.Add(StrPas(sqlite3_column_name(vm,i)), AType, dsMaxStringSize)
+   else
+     FieldDefs.Add(StrPas(sqlite3_column_name(vm,i)), AType);  
    //Set the pchar2sql function
    //Set the pchar2sql function
    if AType in [ftString,ftMemo] then
    if AType in [ftString,ftMemo] then
      FGetSqlStr[i]:=@Char2SqlStr
      FGetSqlStr[i]:=@Char2SqlStr

+ 5 - 2
packages/fcl-db/src/sqlite/sqliteds.pas

@@ -173,8 +173,11 @@ begin
     end else
     end else
     begin
     begin
       AType := ftString;
       AType := ftString;
-    end;
-    FieldDefs.Add(StrPas(ColumnNames[i]), AType, 0, False);
+    end;    
+    if AType = ftString then
+      FieldDefs.Add(StrPas(ColumnNames[i]), AType, dsMaxStringSize)
+    else
+      FieldDefs.Add(StrPas(ColumnNames[i]), AType);  
     //Set the pchar2sql function
     //Set the pchar2sql function
     if AType in [ftString,ftMemo] then
     if AType in [ftString,ftMemo] then
       FGetSqlStr[i]:=@Char2SqlStr
       FGetSqlStr[i]:=@Char2SqlStr