找到了。
Now let's continue with another example. This time we are going to restructure
a table for the sole purpose of changing the password for an encrypted table.
We'll skip the field and index definitions this time since they will not be
changing from the last example. Once again we'll assume a TDBISAMTable component
with the name MyTable.
begin
with MyDBISAMTable do
begin
DatabaseName:='C:/MYDATA';
TableName:='MYTABLE.DAT';
Active:=False; { always make sure the table is closed first }
RestructureFieldDefs.Update; { update the RestructureFieldDefs property
using the existing field definitions
from the table }
RestructureIndexDefs.Update; { update the RestructureIndexDefs property
using the existing index definitions
from the table }
RestructureTable(LGID_ANSI_STD,SRT_DEFAULT,0,0,True,'NewPassword',
'My Test Table',512,-1,False);
end;
end;
That's all there is to it. 6 lines of code and you have changed the password
for the table. Obviously this code can also be adapted for changing any of the
global information such as the table description or the BLOB block size.
但是,如果用Query打开加了密的数据库的时候,他弹出密码框要我输入密码。
如果想略掉这个输入密码框,在程序中输入密码应该怎么办啊???