datagrid绑定recordset对象,不能显示
Option Explicit
Public cn As String
Public cnn As New ADODB.Connection
Public comm As New
Public rs As New ADODB.Recordset
Public sqlc As String
Private Sub Form_Load()
cn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\salary\DATA\salary.mdb;Persist Security Info=False"
sqlc = "select * from 职员"
End Sub
Private Sub Command1_Click()
cnn.ConnectionString = cn
cnn.Open
rs.Open sqlc, cnn, 3, 2
Set DataGrid1.DataSource = rs
rs.Close
cnn.Close
End Sub
请高手指点:
为什么无法显示数据,谢谢