标题:datagrid控件用法
取消只看楼主
xilong83
Rank: 1
等 级:新手上路
帖 子:43
专家分:0
注 册:2007-10-28
 问题点数:0 回复次数:0 
datagrid控件用法

Private Sub Form_Load()
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset
Dim sql As String
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\vb\db1.mdb;Persist Security Info=False"
cnn.Open
sql = "select user,pwd from yh order by user"
rst.Open sql, cnn, adOpenKeyset, adLockOptimistic
rst.MoveFirst
Set DataGrid1.DataSource = rst

End Sub

cnn.CursorLocation = adUseClient

搜索更多相关主题的帖子: datagrid 控件 用法 
2007-10-30 21:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-182103-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.326262 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved