unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TForm2 = class(TForm) Label1: TLabel; Timer1: TTimer; procedure Timer1Timer(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation uses Unit1; {$R *.dfm} procedure TForm2.Timer1Timer(Sender: TObject); Var s,s1:string; f:textfile; begin form2.Timer1.Enabled:=false; Application.CreateForm(TForm1, Form1); getdir(0,s); s1:=s+'\Put.txt'; assignfile(f,s1); try {I$-} reset(f); {I$+} if ioresult=0 then begin readln(f,s); s1:=s; closefile(f); end; except Showmessage('База не найдена!'); Close; exit; end; Form1.ADOConnection1.ConnectionString:=s1; try Form1.ADOConnection1.Connected:=true; except Showmessage('База не найдена!'); Close; exit; end; Form1.Zapros.Active:=true; Form1.R1.Active:=true; Form1.R2.Active:=true; Form1.Show; Form2.Visible:=False; end; end.