整天说我没有数据源
Private Sub Combo1_click()
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select * from 查询1 where 员工编号=" & Combo1.Text & ""
Adodc1.Refresh
End Sub
Private Sub Form_Load()
Dim a1 As String
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source =" & App.Path & "\database.mdb;persist security info=false"
Adodc1.CommandType = adCmdUnknown
Adodc1.RecordSource = "select * from 查询1"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
With Adodc1.Recordset
Do While Not .EOF
Combo1.AddItem .Fields(0).Value
.MoveNext
Loop
.MoveFirst
Combo1.Text = .Fields("员工编号").Value
End With
End Sub
Private Sub Command1_Click()
Set DataGrid1.DataSource = Adodc1
DataReport1.Show
End Sub