帮帮忙,实在试不出来,怎么用代码给paradox表增,删,改口令.Addpassword等方法是用来开口令的.

gum 2001-04-13 03:03:00
加精
...全文
67 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
gum 2001-04-14
  • 打赏
  • 举报
回复
good! dephi我虽不懂,但启发解决了问题,分的双手奉上.
tide 2001-04-13
  • 打赏
  • 举报
回复

不懂delphi,只好找抄原来保存的一份资料,但原能对你有帮助。

add a password to a paradox table ?

Homepage: http://www.swissdelphicenter.ch


unit Unit2;

interface
uses bde,SysUtils,dbtables,windows;

Function TablePasswort(var table: ttable; password:string) : boolean;


implementation


function StrToOem(const AnsiStr: string): string;
begin
SetLength(Result, Length(AnsiStr));
if Length(Result) > 0 then
CharToOem(PChar(AnsiStr), PChar(Result));
end;


Function TablePasswort(var table: TTable; password:string) : boolean;
var pTblDesc : pCRTblDesc;
hDb : hDBIDb;

begin
Result := false;
with Table do begin
if Active and (not Exclusive) then Close;
if (not Exclusive) then Exclusive := True;
if (not Active) then Open;
hDB := DBHandle;
Close;
end;
GetMem(pTblDesc,SizeOf(CRTblDesc));
FillChar(pTblDesc^,SizeOf(CRTblDesc),0 );
with pTblDesc^ do begin
StrPCopy(szTblName, StrToOem(table.tablename));
szTblType:= szParadox;
StrPCopy(szPassword, StrToOem(Password));
bPack := True;
bProtected := True;
end;
if DbiDoRestructure(hDb, 1, pTblDesc, nil, nil, nil, FALSE )<> DBIERR_NONE then exit;
if pTblDesc <> nil then FreeMem(pTblDesc, SizeOf(CRTblDesc));
result := true;
end;




「已注销」 2001-04-13
  • 打赏
  • 举报
回复
难度不小

对俺来说

俺把这个问题往前推一推

期待解决

13,822

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧