选择和插入查询上的运行时错误3021

时间:2014-02-27 01:26:19

标签: mysql vb6

谁能告诉我代码的问题是什么?

编译器说:

  

运行时错误'3021'BOF或EOF为True或当前记录   已被删除。请求的操作需要当前记录。

这意味着什么?这是我的代码。

Public Sub CreateCat(catName As String, CatDescript As String)
Dim sets As String

 qry1 = "select * from tblcategory where category_name='" + catName + "'"
 Set rs = conn.Execute(qry1)

 If rs.Fields("category_name") > 0 Then

    MsgBox "Category name already exist!", vbCritical, "Notification"

 Else

    qry2 = "Insert into tblcategory(category_name,Category_Description)values( '" + LTrim(catName) + "','" + LTrim(CatDescript) + "')"
    conn.Execute(qry2)
    MsgBox "Create Successfully", vbInformation, "Notification"
    CrtUpdtDelCat.Hide
    MainForm.Show

 End If

 Set rs = Nothing

End Sub

0 个答案:

没有答案