以下代码使用Delphi 5编译和工作,但未使用Delphi 10.1 Berlin;在Delphi 10.1中使用BDE API(BdiCopyTable)柏林
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' 和 '阵列字符的[0..260]' 的两倍。
我该如何改变它,使其编译清洁并按预期工作? NB。在大规模迁移的这个阶段,我不能放弃BDE。
你看过StrPCopy的声明 - http://docwiki.embarcadero.com/Libraries/Seattle/en/System.SysUtils.StrPCopy? – RBA
始终包含编译器/异常错误消息。 –
我很震惊BDE可以用这样一个现代版的Delphi工作。我以为他们在很多版本之前彻底删除了它。你是否手动安装它? –