利用VB和sql编写企业员工管理系统,但是再利用datacombo1查询时datagrid无法显示查询内容
Dim ind As IntegerPrivate Sub Command1_Click()
Select Case ind
Case 0
Adodc1.RecordSource = " select * from pay"
Case 1
Adodc1.RecordSource = " select * from pay where" & " 工作证号 = ' " & DataCombo1.Text & " '"
End Select
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
ind = 0
Option1(0).Value = True
End Sub
Private Sub Option1_Click(Index As Integer)
ind = Index
DataCombo1.Text = " "
Select Case Index
Case 0
Case 1
Adodc2.RecordSource = "select 工作证号 from pay"
Adodc2.Refresh
DataCombo1.ListField = "工作证号"
End Select
End Sub