Home > Software engineering >  Vb programming why search access data display blank, program debugging without mistakes
Vb programming why search access data display blank, program debugging without mistakes

Time:09-20

Vb programming why search access data display blank, program debugging error not
Program content is as follows:
Private Sub Command1_Click ()
Dim strSql As String
If Text1. Text & lt;> "" Then
Adodc1. You. Close
If Val (Text1. Text) & gt; 0 Then
StrSql="select * from table1 where num=" & amp; Trim (Text1. Text)
The Else
StrSql="select * from table1 where name='" & amp; Trim (Text1. Text) & amp; "'
"End the If
Adodc1.Com mandType=adCmdText
Adodc1. You. Open strSql
The Set DataGrid1. The DataSource=Adodc1
The Else
The Set DataGrid1. The DataSource=Nothing
End the If
End Sub
Where is the problem? Why shows the blank in the search after the plugin

CodePudding user response:

This is a PE teacher to teach programming?
Don't direct operation Adodc1. You, can affect the function of normal!!!!!!
  • Related