Dim cn As New Connection Dim rs As New Recordset Private Sub Command1_Click() cn.CursorLocation = adUseClient cn.Open "...." rs.Open "....", cn, .... Text1.Text = rs("ActivityName") Set DataGrid1.DataSource = rsEnd Sub
http://www.wzjcw.net/vbgood/taishan/迷你数据浏览器.zip
With Rs If .State = adStateOpen Then .Close End If .ActiveConnection = adoCN .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockBatchOptimistic .Source = "SELECT * FROM Dm_Spdm where deptcode='" & cDeptCode & "' ORDER BY spdm" .Open End With Set DataGrid1.DataSource = rs
Dim adoCn As New Connection Dim Rs As New Recordset With Rs If .State = adStateOpen Then .Close End If .ActiveConnection = adoCN .CursorLocation = adUseClient .CursorType = adOpenDynamic .LockType = adLockBatchOptimistic .Source = "SELECT * FROM Dm_Spdm where deptcode='" & cDeptCode & "' ORDER BY spdm" .Open End With Set DataGrid1.DataSource = rs
Dim rs As New Recordset
Private Sub Command1_Click() cn.CursorLocation = adUseClient
cn.Open "...."
rs.Open "....", cn, ....
Text1.Text = rs("ActivityName")
Set DataGrid1.DataSource = rsEnd Sub
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = adoCN
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockBatchOptimistic
.Source = "SELECT * FROM Dm_Spdm where deptcode='" & cDeptCode & "' ORDER BY spdm"
.Open
End With
Set DataGrid1.DataSource = rs
曾经有一道菜,摆在我的面前,我不想吃,因为我TMD的太菜了。
http://sanjianxia.myrice.com
Dim Rs As New Recordset
With Rs
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = adoCN
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockBatchOptimistic
.Source = "SELECT * FROM Dm_Spdm where deptcode='" & cDeptCode & "' ORDER BY spdm"
.Open
End With
Set DataGrid1.DataSource = rs