求助:类型不匹配 调不过去了 求大仙帮忙
看王国荣的VB数据库设计,范例有一段调不过去了,就在我本上不行,换自己的台式机就OK。。。。求解Private Sub Command2_Click()
List1.Clear
' 搜寻所有「成交量」字段大于10000的股票,使用FindLast及FindPrevious
criteria = "成交量 > 10000"
ret = FindLast(Adodc1.Recordset, criteria) '<-------------在这提示类型不匹配
While ret
List1.AddItem Adodc1.Recordset("股票名称") & " = " & _
Adodc1.Recordset("成交量")
ret = FindPrevious(Adodc1.Recordset, criteria)
Wend
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\\stock01.mdb;Persist Security Info=False"
= adCmdTable
Adodc1.RecordSource = "股票行情表"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub
’Find.bas
' 从最后一笔记录开始向上搜寻
Function FindLast(rs As ADODB.Recordset, ByVal criteria As String)
On Error Resume Next
rs.MoveLast
rs.Find criteria, , adSearchBackward
FindLast = Not rs.BOF And Err.Number = 0
End Function