在Access的窗体上放DataGrid,怎么与Ado相连呀?
若使用recordset as AdoDB.recordset对象怎么连?
我的代码:
Private Sub FORM_Open(Cancel As Integer)
On Error GoTo Except
Dim ConnStr As String
ConnStr = "File Name=" & CurrentProject.Path & "\ast.udl;"
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.Open ConnStr
Dim Recordset As ADODB.Recordset
Set Recordset = New ADODB.Recordset
Recordset.Open "select * from Employe", Conn
Set DataGrid.DataSource = Recordset '这里怎么写?
Exit Sub
Except:
MsgBox "error"
?????????????
WELL,LET TELL YOU A SECRET.
AFTER YOU PUT A DataGrid IN YOUR FORM, YOU CAN GO TO "OBJECT BROWSER" TO GET THE DETAIL HELP. BEFORE YOU DO IT , YOU CAN GET NOTHING IF YOU DO NOT REFER TO IT ON PURPOSE