vb中用SQL语言中的选择功能问题

来源:百度知道 编辑:UC知道 时间:2024/06/03 19:29:48
怎么用datagrid 控件显示已经用select * from <表名> where name like
'李*'这条命令找到到的所有记录呢?比如说找到的记录有五条,怎么全部用datagrid控件显示出来。谢谢!

Private Sub Text1_Change()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\db1.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tabel where name >='李'%"
Adodc1.Refresh'对查询更新
DataGrid1.Refresh
End Sub
此外需设置DataGrid1属性DataSource 为 Adodc1

用%号

select * from <表名> where name like
'李%'