设置控件属性过程:1、ADOConnection1设置1)双击ADOConnection1,进行设置连接字符串(作用是:选取连接驱动方式和连接的数据库设置)。2、ADOQuery1设置: 1)ADOQuery1.connection属性为ADOConnection1;2)ADOQuery1.SQL属性为select student.sno,sname,cname,grade from student,sc,course where student.sno=sc.sno and course.cno=sc.cno3)ADOQuery1.Active设置为TRUE。3、DataSource1设置:DataSet属性为ADOQuery14、DBGrid1设置DataSource属性设置为DataSource1
2.再用TADOQuery和TDataSource控件關聯一下就可以將數據直接顯示在DBGRID中