Mega Code Archive

 
Categories / Delphi / ADO Database
 

Veri tabani icindeki tablolari al

//ADO ==> ADOConnection1, ADOTable1 //Data Access ==> DataSource //Data Controls ==> DBGrid //bilesenlerini ekleyin procedure TForm1.FormCreate(Sender: TObject); begin adoconnection1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+ //aşağı tarafa veri tabınının kodunu yazın 'Data Source=E:\Documents and Settings\sercan\Desktop\sercasp\business.mdb;Persist Security Info=False'; adoconnection1.LoginPrompt:=false; adotable1.Connection:=adoconnection1; datasource1.DataSet:=adotable1; dbgrid1.DataSource; end; procedure TForm1.Button1Click(Sender: TObject); begin adoconnection1.GetTableNames(listbox1.Items,false); end; procedure TForm1.ListBox1DblClick(Sender: TObject); begin adotable1.Close; adotable1.TableName:=listbox1.Items.Strings[listbox1.itemindex]; adotable1.Open; end;