K
kadi88
Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下:
procedure TMainForm.M_configClick(Sender: TObject);
begin
MainDataModule.AC.Close;
EditConnectionString(MainDataModule.AC);
MainDataModule.AC.Open;
//问题是否出在这是否在此要写一个取得MainDataModule.AC的ConnectionString的函数?
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
Ini := TIniFile.Create(ChangeFileExt(Paramstr(0),'Ini'));
try
//读取
MainDataModule.AC.ConnectionString :=
Ini.ReadString('Data','Connection',MainDataModule.AC.ConnectionString);
finally
Ini.Free;
end;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
try
//设定
Ini.WriteString('Data','Connection',MainDataModule.AC.ConnectionString);
finally
Ini.Free;
end;
end;
procedure TMainForm.M_configClick(Sender: TObject);
begin
MainDataModule.AC.Close;
EditConnectionString(MainDataModule.AC);
MainDataModule.AC.Open;
//问题是否出在这是否在此要写一个取得MainDataModule.AC的ConnectionString的函数?
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
Ini := TIniFile.Create(ChangeFileExt(Paramstr(0),'Ini'));
try
//读取
MainDataModule.AC.ConnectionString :=
Ini.ReadString('Data','Connection',MainDataModule.AC.ConnectionString);
finally
Ini.Free;
end;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
try
//设定
Ini.WriteString('Data','Connection',MainDataModule.AC.ConnectionString);
finally
Ini.Free;
end;
end;