Private Sub Cmdselect_Click() On Error GoTo IErrIf DBrs1.State = 1 Then DBrs1.Close End If If DBrs2.State = 1 Then DBrs2.Close End If Adodc1.RecordSource = Text2.Text Adodc1.Refresh '.... '....数据处理
Exit Sub IErr: '出错处理 End Sub
还是不行啊?还是会有出错提示信息。当输入一个错误的操作语句时提示信息为: Adodc1 [Microsoft][ODBC Microsoft Access Driver]无效的SQL语句····· 单击提示信息的“确定”按钮之后,程序能继续运行。 我的意思是连出错提示信息也不显示,
Private Sub Cmdselect_Click()
On Error GoTo IErrIf DBrs1.State = 1 Then
DBrs1.Close
End If
If DBrs2.State = 1 Then
DBrs2.Close
End If
Adodc1.RecordSource = Text2.Text
Adodc1.Refresh
'....
'....数据处理
Exit Sub
IErr:
'出错处理
End Sub
Adodc1
[Microsoft][ODBC Microsoft Access Driver]无效的SQL语句·····
单击提示信息的“确定”按钮之后,程序能继续运行。
我的意思是连出错提示信息也不显示,
toggle-->break on unhandled errors