vb的datagrid控件怎么使用?怎样用rs打开数据?
2个回答
展开全部
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.Open "provider=microsoft.jet.oledb.4.0;data source=cx_task.mdb"
DataGrid1.AllowUpdate = True
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "select * from 表 where 条件"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
conn.Close
以上你参考一下吧!
Set rs = New ADODB.Recordset
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.Open "provider=microsoft.jet.oledb.4.0;data source=cx_task.mdb"
DataGrid1.AllowUpdate = True
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "select * from 表 where 条件"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
conn.Close
以上你参考一下吧!
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询