在 Delphi 10.1 Berlin 中使用 BDE API (BdiCopyTable)

Using BDE API (BdiCopyTable) with Delphi 10.1 Berlin

以下代码使用 Delphi 5 但不使用 Delphi 10.1 Berlin;

编译和工作
function CopyTable(const tSource: TwwTable; const Destination: string): DBIResult;
var
   pSourceTableName, pDestination: array[0..DBIMAXTBLNAMELEN] of char;
begin
     tSource.Open;
     StrPCopy(pSourceTableName, tSource.TableName);
     StrPCopy(pDestination, Destination);
     Result := DbiCopyTable(tSource.DBHandle, False, pSourceTableName, nil, pDestination);
     tSource.Close;
end;

编译器报告 [dcc32 错误] SUPPORT1.PAS(3655):E2010 不兼容类型:'PAnsiChar' 和 'array[0..260] of Char' 两次。

如何更改它以使其编译干净并按预期工作? 注意。我不能在这个大迁移阶段废弃 BDE。

DbiCopyTable 期望 AnsiChar,因此您应该相应地声明两个 char 数组。