My DSN file create using Wizard on ADOConnection component: using DBase IV as example!!! ---------- Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="CollatingSequence=ASCII;DefaultDir=D: \RADRX111Tests\VCL_creating_a_DBF_DBase_file;Deleted=0;Driver={Driver do Microsoft dBase (*.dbf)};DriverId=277;FIL=dBase IV;FILEDSN=D:\RADRX111Tests\VCL_creating_a_DBF_DBase_file \MyDBFFile.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Statistics=0;Threads=3; UID=admin;UserCommitSync=Yes;" ----------
{ // create my table-file with my fields: ADOQuery1 string = create table MyDBFtb(ID char(10), Names char(30))
//using my "MyDBFtb" table in SQL or you can use an ADOTable as Dataset: ADOQuery2 string = select * from MyDBFtb }
procedure TForm1.Button1Click(Sender: TObject); var MyReturn: integer; begin ADOConnection1.Connected := false; ADOConnection1.ConnectionString := 'FILE NAME=D:\RADRX111Tests\VCL_creating_a_DBF_DBase_file\MyDBFFile.dsn;'; ADOConnection1.Connected := true; // if not FileExists('..\..\MyDBFtb.dbf') then MyReturn := ADOQuery1.ExecSQL; // ADOQuery2.Open; // open the table "MyDBFtb" using SQL query! end;
Differences between DBase IV and 5 on DSN file : ---------- FIL=dBase IV DriverId=277 ---------- FIL=dBase 5.0 DriverId=533
the rest it's the same!
[ODBC] DRIVER=Driver do Microsoft dBase (*.dbf) UID=admin UserCommitSync=Yes Threads=3 Statistics=0 SafeTransaction_s=0 PageTimeout=5 MaxScanRows=8 MaxBufferSize=2048 FIL=dBase IV DriverId=277 Deleted=0 DefaultDir=D:\RADRX111Tests\VCL_creating_a_DBF_DBase_file CollatingSequence=ASCII
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!
procedure TForm1.Button2Click(Sender: TObject); begin // see on HELP "Data.Win.ADODB.TCustomADODataSet.LockType" use: // ADOQuery3.Clone(ADOQuery2); end;
此帖子包含附件: 大小:16.6K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!
for var MyFieldX in ADOQuery2.Fields do FieldsSizeTotal := FieldsSizeTotal+MyFieldX.Size; caption:= FieldsSizeTotal.ToString
... JBDM4 char(100))' + ... > 4000bytes
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!
dBase IV limitations Last updated: 15 Nov 2003 by XpertSS.com
Approach can use a number of different database file structures, but uses dBaseIV by default. dBaseIV has the following limitations that you might need to be aware of:
maximum file size = 2 gigabytes (per type .dbf or .dbt file) maximum records per database = 1,000,000,000 (1 billion) maximum of 30 open dBaseIV databases on a single computer maximum number of fields per record = 255 maximum size of a record = 4000 characters (= all the field-lengths added together)
https://www.dbase.com/Knowledgebase/faq/dBASE_Limits_FAQ.html
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!
in your case, you needs use "MASTER / DETAILS" technic!!!
dbfMaster -> main fields with ID dbDetails1 -> mainID, other fields dbDetails2 -> mainID, other fields dbDetails3 -> mainID, other fields ...
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!