vb连SQL数据库,datagrid问题,急!
大家过来看看,为何下面代码不能把数据库表里的数据导入到DataGrid中呢?Option Explicit
Dim objcn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
objcn.ConnectionString = "FileDSN=dbmanpower.dsn;UID=;PWD="
objcn.Open
rs.Open "select * from tbUser ", objcn, adOpenKeyset, adLockOptimistic
objcn.CursorLocation = adUseClient
rs.MoveFirst
Set DataGrid1.DataSource = rs
End Sub
小弟郁闷了一天了。。。