D7 我现在需要用程序生成一个dbf的表,但这个表有120个字段,我发现只要到了40个字段,就会报错delphi record size is too big for table table dose not exist 请问下这个问题该如何解决? function DataExports(NZYH: string; NDataset: tadodataset): Boolean; var
NConStr: string; NPath: string; NStr: string; BaseName: string; TableName: string; table: Ttable; begin try table := TTable.Create(nil); table.Close; table.Active := false; table.Exclusive := true; table.TableName := NZYH; table.TableType := ttFOXPRO; with table.FieldDefs do begin Clear; with AddFieldDef do begin Name := 'USERID_'; DataType := ftString; Size := 60; end;
with AddFieldDef do begin Name := 'USERNAME'; DataType := ftString; Size := 60; end;
----------------------------------------------
-敢于学习,谦虚学习,鼓励批评!!
var MyTableName : string; // max 31 chars MyFieldSize : byte; // max 254 chars MyTotalCharsPerRecord: smallint = 4000; // max 4.000 bytes DBase IV (DBase for Windows = 32.767) MyMaxFieldPerTable : byte = 255; // max 255 DBase IV (DBase for Windows = 1.024) // MyFieldName : string; // max 31 chars // MyMaxIndexTagsPerMDX : byte = 47; // max 47 DBase IV // MyMaxIndexMDXMasterOpened : byte = 10; // max 10 // MyMaxKeyExpressionSizeInChars: byte = 220; // max 220 // MyMaxBytesInTableDBF : integer = 2000000000; // max 2 billion // MyMaxRecordsOnTable : integer = 1000000000; // max 1 billion // MyTTable : TTable; MyTFieldDefs: TFieldDefs; // MyFieldsNames : TArray<string>; MyFieldsStringSize: byte;
function MyRecordsSizeTotal(AFieldDefs: TFieldDefs): integer; begin result := -1; // if (AFieldDefs = nil) then exit; // try for var i: integer := 0 to (AFieldDefs.Count - 1) do result := result + AFieldDefs.Items[i].Size; except on E: Exception do ShowMessage('My error:' + sLineBreak + E.Message); end; end;
procedure TForm1.FormCreate(Sender: TObject); begin MyOpenDatabase; end;