Home > Software engineering >  Is not NULL, but there is an error 94 invalid use NULL
Is not NULL, but there is an error 94 invalid use NULL

Time:10-05

Try to weave a random lottery program
Data from excel spreadsheet
Out man according to his work unit, work number and phone number
But every time when executed immediately hand the column longer if there are two Numbers or data will appear this error but work in number that a list of error no matter how long the digital will not

The code is as follows:
 Private Sub Command2_Click () 

Adodc1. The ConnectionString="Provider=Microsoft. Jet. The OLEDB. 4.0; Data Source="+ App. Path +"/list. XLS. Extended Properties='EXCEL 8.0; HDR=YES; IMEX=1 '"
Adodc1. RecordSource="Select * from [Sheet1 $] where industry='" + Combo1. Text +"' "
Adodc1. Refresh
Randomize
Dim As Integer I
EOF Then If Not Adodc1. You.
I=Int (Rnd * Adodc1. You. RecordCount) + 1
Adodc1. You. Move the I - 1
Label1. Caption=Adodc1. You. Fields (1)
Label3. Caption=Adodc1. You. Fields (9)
Label8. Caption=Adodc1. You. Fields (6)
Label4. Caption=Adodc1. You. Fields (10)

The Else
MsgBox "does not meet conditions data!" VbOKOnly, "system messages
"End the If
End Sub


Private Sub Form_Load ()
Adodc1. The ConnectionString="Provider=Microsoft. Jet. The OLEDB. 4.0; Data Source="+ App. Path +"/bid evaluation experts personnel list. XLS. Extended Properties='EXCEL 8.0; HDR=YES; IMEX=1 '"
Adodc1. RecordSource="Select Distinct industry from [Sheet1 $] order by industry"
Adodc1. Refresh
While Not Adodc1. You. EOF
Combo1. AddItem Adodc1. You. Fields (" industry ")
Adodc1. You. MoveNext
Wend
End Sub


Wrong statement is Label4. Caption=Adodc1. You. Fields (10)
Form is the

Help you a great god!!!!!

CodePudding user response:

Using isnull (Adodc1. You. Fields (10)) to evaluate, tracking and see...

CodePudding user response:

Label4. Caption=Adodc1. You. Fields (10) & amp; ""

CodePudding user response:

Your picture looks very strange, and merge in this form?

Although excel can use the way of database operations, but is not recommended, the somebody else is not specially used for database. And a lot of time because have entered manually and automatically data format conversion and puzzling of trouble to the program.

In the end, your program is not robust
Similar Label3. Caption=Adodc1. You. Fields (9) the code, as long as a null values collapsed.

CodePudding user response:

refer to the second floor of123 response:
Label4. The Caption=Adodc1. You. The Fields (10) & amp; ""


This is two picture
  • Related