求助关于数据库的问题
请教一下,代码错在什么地方。运行之后的提示错误是 “未找到方法或数据成员”'str定义在通用里
Private Sub Command2_Click()
Dim a, i As Integer
str = Combo1.Text
For i = 0 To 3
If Option1(i).Value = True Then
a = i
End If
Next i
Select Case a
Case 0
DataGrid1.DataSource = Adodc1(1)
DataGrid1.Refresh
Case 1
DataGrid1.DataSource = Adodc1(2)
DataGrid1.Refresh
Case 2
DataGrid1.DataSource = Adodc1(3)
DataGrid1.Refresh
Case 3
DataGrid1.DataSource = Adodc1(4)
DataGrid1.Refresh
End Select
End Sub
Private Sub Form_Load()
'Adodc1(0)的RecordSource属性先定义了
Adodc1(1).RecordSource = "select * from 加班 where 职工号='&str&'"
Adodc1(2).RecordSource = "select * from 请假 where 职工号='&str&'"
Adodc1(3).RecordSource = "select * from 考勤统计 where 职工号='&str&'"
Adodc1(4).RecordSource = "select * from 出差 where 职工号='&str&'"
End Sub