Delphi XE data access with ADO
Step 1.
Open new project
Step 4.
double click on button and copy below codes
var aa:string;
begin
aa := 'SELECT * FROM Tablename ';
with tablename do
begin
Active := False;
SQL.Clear;
SQL.Add(aa);
ExecSQL;
end;
tablename.Open;
edit1.Text := Tablename.FieldByName('fieldname').AsString;
end;
Open new project
Step 2.
Insert ADO connection object and ADO table object (rename with your table name)
build the database connection with ADO connection
Step 3.
Add button and and edit box
double click on button and copy below codes
var aa:string;
begin
aa := 'SELECT * FROM Tablename ';
with tablename do
begin
Active := False;
SQL.Clear;
SQL.Add(aa);
ExecSQL;
end;
tablename.Open;
edit1.Text := Tablename.FieldByName('fieldname').AsString;
end;
Comments
Post a Comment