如果记录存在 [英] If Record Exist
本文介绍了如果记录存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI,
当用户尝试添加表中已有的新项目时,我想做的是
(示例尝试添加已经在Name_Table中的名称。
msgbox弹出并告诉用户该名称已经在表格中
$ b无论如何,$ b在Visual Basic 2005中都有这样做
谢谢(任何帮助)
解决方案
使用sql语句类似
从表中选择*其中name =''juan dela crus''
如果返回值为1或更多,那么名字存在
谢谢
你能给我一个例子vb代码
谢谢
示例:
SQL =从表中选择*,其中name =''juan dela crus''
设置rs = conn.execute(SQL)
如果不是rs.eof那么
msgbox" Oyee文件alrea dy存在^ __ ^"
结束如果
..hope解决你的问题^ __ ^
HI,
What i trying to do is
when a user try to add new item that already in the table
(example try to add a "name" that already in the "Name_Table")
msgbox pops up and tell the user that the name is already in the table
is there anyway to do this in Visual basic 2005
Thanks (Any help)
解决方案
Use a sql statement something like
Select * from table where name=''juan dela crus''
if the return value is 1 or more then the name is exist
Thanks
Could you give me a example vb code
Thank you
SAMPLE:
SQL = Select * from table where name=''juan dela crus''
set rs = conn.execute(SQL)
if not rs.eof then
msgbox "Oyee file already exist ^__^"
end if
..hope that solve your problem ^__^
这篇关于如果记录存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文