procedure TForm1.Button1Click(Sender: TObject); begin Table1.Tablename:= 'CUSTOMER'; Table1.Active:= True; end; |
procedure TForm1.Button1Click(Sender: TObject);
begin
Database1.DatabaseName:= 'MyNewAlias';
Database1.DriverName:= 'STANDARD';
Database1.Params.Clear; Database1.Params.Add('PATH=C:\DELPHI\DEMOS\DATA'); Table1.DatabaseName:= 'MyNewAlias'; Table1.TableName:= 'CUSTOMER'; Table1.Active:= True; DataSource1.DataSet:= Table1; DBGrid1.DataSource:= DataSource1; end; |
procedure TForm1.Button1Click(Sender: TObject); begin Query1.SQL.Clear; Query1.SQL.ADD( 'SELECT DISTINCT * FROM CUSTOMER C, SALES S WHERE (S.CUST_NO = C.CUST_NO) ORDER BY C.CUST_NO, C.CUSTOMER'); Query1.Active:= True; end; |
procedure TForm1.Buttton1Click(Sender: TObject); var NewString: string; ClickedOK: Boolean; begin NewString := 'C:\'; ClickedOK := InputQuery('Database Path', 'Path: --> C:\DELPHI\DEMOS\DATA', NewString); if ClickedOK then begin Database1.DatabaseName:= 'MyNewAlias'; Database1.DriverName:= 'STANDARD'; Database1.Params.Clear; Database1.Params.Add('Path=' + NewString); Table1.DatabaseName:= 'MyNewAlias'; Table1.TableName:= 'CUSTOMER'; Table1.Active:= True; DataSource1.DataSet:= Table1; DBGrid1.DataSource:= DataSource1; end; end; |