Por favor revicen este código
Publicado por Alex (19 intervenciones) el 10/06/2005 16:13:57
procedure TForm1.activar;
var
tabla:TDataSet;
i:integer;
begin
for i:=0 to componentcount-1 do
if (components[i]is TDataSet) then
begin
tabla:=TDataSet(components[i]);
tabla.Open;
end;
end;
procedure TForm1.Salir1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Conectar1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\aggonzalez\Mis documentos\conet\db1.mdb;Persist Security Info=False';
ADOConnection1.Connected:=true;
activar;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
try
ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\aggonzalez\Mis documentos\conet\db1.mdb;Persist Security Info=False';
ADOConnection1.Connected:=true;
activar;
except
ShowMessage('No existe la base localicela');
end;
end;
end.
var
tabla:TDataSet;
i:integer;
begin
for i:=0 to componentcount-1 do
if (components[i]is TDataSet) then
begin
tabla:=TDataSet(components[i]);
tabla.Open;
end;
end;
procedure TForm1.Salir1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Conectar1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\aggonzalez\Mis documentos\conet\db1.mdb;Persist Security Info=False';
ADOConnection1.Connected:=true;
activar;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
try
ADOConnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\aggonzalez\Mis documentos\conet\db1.mdb;Persist Security Info=False';
ADOConnection1.Connected:=true;
activar;
except
ShowMessage('No existe la base localicela');
end;
end;
end.
Valora esta pregunta
0