# Re: 有人可以帮帮我吗?有关dbgrid的问题,急~~~~~~

Posted by dino on August 08, 1999 at 13:52:49:

In Reply to: Re: 有人可以帮帮我吗?有关dbgrid的问题,急~~~~~~ posted by 小琳 on August 08, 1999 at 10:53:12:

(1)在form中加入data control -- data1
及dbgrid -- grid1
(2)Set data1 properities:
databasename="c:\path\xxx.mdb"
recordsource="tabel_name"
(3)Set grid properities:
grid1.datasource="data1"
(4)建一个command button -- command1
及text box -- text1
(5)command1:
Private sub command1()
Data1.RecordSource = "select * from table_name where field_name='" & Text1.Text & "'"
Data1.Refresh
grid1.Refresh
end sub
若field是数字...
"select * from table_name where field_num=" & Text1.Text

祝好运

Follow Ups: