Board index » delphi » How to create paradox table with BLOCK SIZE = 32768 in Delphi application

How to create paradox table with BLOCK SIZE = 32768 in Delphi application

Hi

I am writing a delphi application. I create a paradox table and
then I try to write a lot of records in it. But the block size value is smaller than i need so I can not write all the records.
I saw that it's possible to change the BLOCK SIZE in the Control Panel | Bde configuration but I prefer to do this in my application.
Have you any ideas!

GG

 

Re:How to create paradox table with BLOCK SIZE = 32768 in Delphi application


Quote
GG wrote:
> I am writing a delphi application. I create a paradox table and
> then I try to write a lot of records in it. But the block size value is smaller than i need so I can not write all the records.
> I saw that it's possible to change the BLOCK SIZE in the Control Panel | Bde configuration but I prefer to do this in my application.
> Have you any ideas!

Bill Todd's standard answer for such kind of questions:

"See the examples for DbiOpenCfgInfoList at
www.borland.com/devsupport/bde/bdeapiex ."

Martin

Re:How to create paradox table with BLOCK SIZE = 32768 in Delphi application


SetConfigParameter('\DRIVERS\PARADOX\TABLE CREATE\;BLOCK SIZE', '32768');

procedure SetConfigParameter(Param: string; Value: string);
var
  hCur: hDBICur;
  rslt: DBIResult;
  Config: CFGDesc;
  Path, Option: string;
  Found: boolean;
  Temp_Array: array[0..255] of char;
begin

  Check(dbiInit(nil));
  hCur := nil;
  Found := False;
  try

    if Pos(';', Param) = 0 then

      raise EDatabaseError.Create('Invalid parameter passed to function.
There must ' +
         'be a semi-colon delimited sting passed');

    Path := Copy(Param, 0, Pos(';', Param) - 1);
    Option := Copy(Param, Pos(';', Param) + 1, Length(Param) - Pos(';',
Param));

    Check(DbiOpenCfgInfoList(nil, dbiREADWRITE, cfgPERSISTENT,
    StrPCopy(Temp_Array, Path), hCur));
    repeat
      rslt := DbiGetNextRecord(hCur, dbiNOLOCK, @Config, nil);
      if rslt = DBIERR_NONE then
      begin
        if StrPas(Config.szNodeName) = Option then
        begin
          StrPCopy(Config.szValue, Value);
          Check(DbiModifyRecord(hCur, @Config, FALSE));
          Found := True;
          break;
        end;
      end
      else
        if rslt <> DBIERR_EOF then
          Check(rslt);

    until rslt <> DBIERR_NONE;
    if Found = False then
      raise EDatabaseError.Create(Param + ' entry was not found in
configuration file');

  finally
    if hCur <> nil then
    begin
      Check(DbiCloseCursor(hCur));
      Check(DbiExit);
    end;
 end;

end;
///////////////
Which I got from www.borland.com/devsupport/bde/bdeapiex

Other Threads