分类：电脑/网络-程序设计
问题：VB6ADODC的find方法出错的问题PrivateSubcm 
Private Sub cmdfind_lick() '查找数据Dim str As StringDim mybookmark As Variantmybookmark = Adodc1.Recordset.Bookmarkstr = InputBox("输入查找表达式", "如年龄=9", "查找")Text2.Text = mybookmarkText3.Text = strIf str = "" Then Exit SubAdodc1.Recordset.MoveFirstAdodc1.Recordset.FPrivate Sub cmdfind_lick() '查找数据Dim str As StringDim mybookmark As Variantmybookmark = Adodc1.Recordset.Bookmarkstr = InputBox("输入查找表达式", "如年龄=9", "查找")Text2.Text = mybookmarkText3.Text = strIf str = "" Then Exit SubAdodc1.Recordset.MoveFirstAdodc1.Recordset.Find strIf Adodc1.Recordset.EOF ThenMsgBox "指定的条件没有匹配的记录", , "信息提示"Adodc1.Recordset.Bookmark = mybookmarkEnd IfEnd Sub当输入“年龄=9”之类的时候可以找到要找的数据，可是输入“姓名=XX”时候就显示哪位高手指点一下？
回答：LS查找数据的时候=XX改为='XX'意见正确,但Dim str As String 需要改成Dim str As VariantPrivate Sub cmdfind_lick()    Dim str As Variant    Dim mybookmark As Variant    mybookmark = Adodc1.Recordset.Bookmark    str = InputBox("输入查找表达式", "如年龄=9", "查找")    Text2.Text = mybookmark    Text3.Text = str    If str = "" Then Exit Sub    Adodc1.Recordset.MoveFirst    Adodc1.Recordset.Find str    If Adodc1.Recordset.EOF Then        MsgBox "指定的条件没有匹配的记录", , "信息提示"        Adodc1.Recordset.Bookmark = mybookmark    End IfEnd Sub