如何在Windows基础网络应用程序中验证ms访问数据库中的重复记录..? [英] how to validate duplicate record in ms access database in windows base network application..?

查看:63
本文介绍了如何在Windows基础网络应用程序中验证ms访问数据库中的重复记录..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




开发Windows基础网络应用程序时我实际上遇到问题当两个用户创建具有相同数据库的记录时,如果我使用自动编号字段作为记录ID,则它将接受重复记录我怎样才能避免这个问题....

Hi
While developing windows base network application i got problem actually when two user creating records with same database it will accept duplicate record if i am using auto number field as record id so how can i avoid this problem....

推荐答案

使用主键验证数据。它限制数字以创建重复值。
Use Primary Key for validating data.It restricts the numbers to create duplicate values.


自动编号字段不会保护您免受逻辑重复。它只是为您的记录提供了一个新的唯一值。



要为一组列强制执行唯一性,您需要创建一个唯一约束或索引。



有关创建唯一索引的语法,请查看 CREATE INDEX语句(Microsoft Access SQL) [ ^ ]
Auto numbering field does not protect you from logical duplicates. It just simply provides a new unique value for your record.

To enforce uniqueness for a set of columns you need to either create a unique constraint or index.

For the syntax for creating a unique index, have a look at CREATE INDEX Statement (Microsoft Access SQL)[^]


这篇关于如何在Windows基础网络应用程序中验证ms访问数据库中的重复记录..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆