Home > Software engineering > Rookie a type mismatch is not passed, please help! Some machines, some not.. speechless
Rookie a type mismatch is not passed, please help! Some machines, some not.. speechless
Time:11-01
See guo-rong wang VB database design, sample have a not the past, is not in my book, in exchange for his desktop is OK,,,, to solve the Private Sub Command2_Click () List1. Clear 'search (volume) all fields more than 10000 shares, using FindLast and FindPrevious The criteria="volume & gt; 10000 "Ret=FindLast (Adodc1. You, the criteria) '& lt; -- -- -- -- -- -- -- -- -- -- -- -- -- in this tip type does not match the While ret List1. AddItem Adodc1. You (the name of "stock") & amp; "=" & amp; _ Adodc1. You (" volume ") Ret=FindPrevious (Adodc1. You, the criteria) Wend End Sub
Private Sub Form_Load () Adodc1. The ConnectionString="Provider=Microsoft. Jet. The OLEDB. 3.51; Data Source="& amp; App. The Path & amp; "\ \ stock01 MDB. Persist Security Info=False " Adodc1.Com mandType=adCmdTable Adodc1. RecordSource="stock list" Adodc1. Refresh The Set DataGrid1. The DataSource=Adodc1
End Sub
'the Find. Bas 'since the last record up search The Function FindLast (rs As ADODB library. You, ByVal criteria As String) On the Error Resume Next Rs. MoveLast Rs. Find the criteria, and adSearchBackward FindLast=Not rs. BOF And Err. Number=0 End the Function
CodePudding user response:
You don't have a defined variable type, the system will default to variant dim criteria as string The criteria="volume & gt; 10000"