我使用ADODC控件打开数据库,而程序只能读到第一行的数据,其他行的数据读不到,我得程序代码如下:
Private Sub Command4_Click()
Adodc1.Recordset.MoveFirst '指针指向第一列'
Do Until Adodc1.Recordset.Fields(1).Value = Text3.Text '如果text3中的内容满足第一列开始读数'
Adodc1.Recordset.MoveNext '否则搜索下一行'
Loop
Select Case Text2.Text
Case Is <= 100
Text4.Text = Adodc1.Recordset.Fields(2).Value '显示许用应力'
Case Is <= 200
Text4.Text = Adodc1.Recordset.Fields(3).Value
Case Is <= 300
Text4.Text = Adodc1.Recordset.Fields(4).Value
Case Is = 400
Text4.Text = Adodc1.Recordset.Fields(5).Value
End Select
End Sub
Private Sub Command5_Click()
Form3.Show '打开form3选择外径'
End Sub
Private Sub menu1_Click()
Text3.Text = menu1.Caption
End Sub
Private Sub menu2_Click()
Text3.Text = menu2.Caption
End Sub
Private Sub menu3_Click()
Text3.Text = menu3.Caption
End Sub
Private Sub menu4_Click()
Text3.Text = menu4.Caption
End Sub
请高手指教,因为最近新学习VB和数据库所以很多困难,基础知识有所欠缺,请大家帮忙!