procedure TForm1.btnOKClick(Sender: TObject);
var sdrive : string;
sparam : TStringList;
bnew : Boolean;
begin
if Table1.State in dsEditModes then
Table1.Post;
sparam := TStringList.Create;
sparam.Add('SERVER NAME='+DBEdit1.Text);
sparam.Add('DATABASE NAME='+DBEdit2.Text);
sparam.Add('USER NAME='+DBEdit3.Text);
sparam.Add('BLOB SIZE=300');
sparam.Add('ENABLE BCD=TRUE');
sparam.Add('DATE MODE=2');
bNew := True;
if Session.IsAlias(DBEdit5.Text) then
begin
sdrive := Session.GetAliasDriverName(DBEdit5.Text);
if sdrive = 'MSSQL' then
begin
Session.ModifyAlias(DBEdit5.Text,sparam);
bNew := False;
end
else
Session.DeleteAlias(DBEdit5.Text);
end;
if bNew then
Session.AddAlias(DBEdit5.Text,'MSSQL',sparam);
Session.SaveConfigFile;
sparam.Clear;
Close;
end;
var sdrive : string;
sparam : TStringList;
bnew : Boolean;
begin
if Table1.State in dsEditModes then
Table1.Post;
sparam := TStringList.Create;
sparam.Add('SERVER NAME='+DBEdit1.Text);
sparam.Add('DATABASE NAME='+DBEdit2.Text);
sparam.Add('USER NAME='+DBEdit3.Text);
sparam.Add('BLOB SIZE=300');
sparam.Add('ENABLE BCD=TRUE');
sparam.Add('DATE MODE=2');
bNew := True;
if Session.IsAlias(DBEdit5.Text) then
begin
sdrive := Session.GetAliasDriverName(DBEdit5.Text);
if sdrive = 'MSSQL' then
begin
Session.ModifyAlias(DBEdit5.Text,sparam);
bNew := False;
end
else
Session.DeleteAlias(DBEdit5.Text);
end;
if bNew then
Session.AddAlias(DBEdit5.Text,'MSSQL',sparam);
Session.SaveConfigFile;
sparam.Clear;
Close;
end;