M
mastersky
Unregistered / Unconfirmed
GUEST, unregistred user!
我找到一个程序
function ModifyNetDir(newdir:string):Boolean;
var
hCur : hDBICur;
Config : CFGDesc;
ContinueIt: boolean;
begin
Result:=False;
if not DirectoryExists(newdir) then
Exit;
if DbiInit(nil) = DBIERR_NONE then
begin
hCur := nil;
try
if DbiOpenCfgInfoList(nil, dbiREADWRITE, cfgPersistent,
'/DRIVERS/PARADOX/INIT', hCur) = DBIERR_NONE then
begin
if DbiSetToBegin(hCur) = DBIERR_NONE then
begin
ContinueIt := true;
while ContinueIt do
begin
if(DbiGetNextRecord(hCur, dbiWRITELOCK, @Config, nil)<> DBIERR_NONE) then
ContinueIt := false
else if StrIComp(Config.szNodeName, 'NET DIR') = 0 then
begin
StrCopy(Config.szValue, PChar(NewDir));
Check(DbiModifyRecord(hCur, @Config, True));
ContinueIt := false;
Result:=True;
end;
end;
end;
end;
Check(DbiExit);
finally
if (hCur <> nil) then
Check(DbiCloseCursor(hCur));
end;
end;
end;
但是并修改没有成功.高手请指导.谢谢!
function ModifyNetDir(newdir:string):Boolean;
var
hCur : hDBICur;
Config : CFGDesc;
ContinueIt: boolean;
begin
Result:=False;
if not DirectoryExists(newdir) then
Exit;
if DbiInit(nil) = DBIERR_NONE then
begin
hCur := nil;
try
if DbiOpenCfgInfoList(nil, dbiREADWRITE, cfgPersistent,
'/DRIVERS/PARADOX/INIT', hCur) = DBIERR_NONE then
begin
if DbiSetToBegin(hCur) = DBIERR_NONE then
begin
ContinueIt := true;
while ContinueIt do
begin
if(DbiGetNextRecord(hCur, dbiWRITELOCK, @Config, nil)<> DBIERR_NONE) then
ContinueIt := false
else if StrIComp(Config.szNodeName, 'NET DIR') = 0 then
begin
StrCopy(Config.szValue, PChar(NewDir));
Check(DbiModifyRecord(hCur, @Config, True));
ContinueIt := false;
Result:=True;
end;
end;
end;
end;
Check(DbiExit);
finally
if (hCur <> nil) then
Check(DbiCloseCursor(hCur));
end;
end;
end;
但是并修改没有成功.高手请指导.谢谢!