大学生礼仪情景剧剧本:请教vb的datagrid怎样动态显示一个记录集呀?

来源:百度文库 编辑:神马品牌网 时间:2024/05/15 02:50:33
已知在窗体上有一个datagrid控件,运行下面的代码后datagrid控件没有显示,问题出在哪呀?
Private Sub cmdPJ_Click()
comm.CommandText = "select yw from biao where bjdm=4 order by yw desc"
rs.Open comm, , adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rs
DataGrid1.Refresh
End Sub

select yw from biao where bjdm=4 order by yw desc

看看这个语句在数据库里 有没有相关记录