MS Access数据库问题 [英] MS Access database problem
本文介绍了MS Access数据库问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
我有疑问,希望有人能帮助我解决这个问题.
例如,在我的项目中有textboxt,datetimepicker,datagridview和MS Access baza
我有两个Colums:
hi.
I have question and hope that somebody will help me to solve this problem.
for example there are textboxt , datetimepicker, datagridview and MS Access baza in my project
I have two Colums:
Column Account Column Datetime
4 02/02/2011 (true)
1 03/02/2011 (true)
4 (adding second time) 04/05/2011 (in the same year) i want to get error (False)
4 01/01/2012 (true)
当我第一次在数据库中添加"4"时,这是正常的……如果我想在同一年第二次添加"4",则我想取错误".我一年内要一个帐号.
在此先感谢....
希望您能对我有所帮助.
And it is normal when I add "4" to database first time... I want to take "error" if i want to add "4" second time with the same year. I want one account number in one year..
Thanks in advance....
hope you will help me.
推荐答案
已阅读 SQL Check Constraints !阅读:
SQL检查约束 [ SQL CHECK约束-2 [
Have a read on SQL Check Constraints! Read:
SQL CHECK Constraints[^]
SQL CHECK Constraint - 2[^]
You can have check constraints in place and go ahead smoothly.
Other way would be to handle it in UI itself.
在MS Access中,创建验证规则很容易.在表中转到设计视图",选择要验证的列,然后在常规"选项卡的下面创建验证规则.将会弹出一个向导.希望这会有所帮助.
In MS Access, it is easy to create a validation rule. In your table go to Design View, select the column you would like to validate, and underneath in the General tab you can create a validation rule. There is a wizard which will pop up. Hope this helps.
这篇关于MS Access数据库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文