vb判断重复问题

在添加一条信息时,先判断库中是否还有相同的信息,判断的代码怎么写!?

ADO rs.open "select * from tableName where filedname(一般是主键)='" & text1.text & "'" (text1里面是字符串型) rs.open "select * from tableName where filedname(一般是主键)=" & text1.text (text1里面是数字类型) if rs.eof=false then msgbox "信息重复,请重新输入!" end if

麻烦采纳,谢谢!
温馨提示:答案为网友推荐,仅供参考