数据表设计中的默认值
我正在 Access 中设计一个数据表。我有两列,其值类似于:
col1: CU001-
col2: 03
我想连接这两个字符串以形成另一列的默认值,例如: CU001-03 我该怎么做?
还有一个问题是使用字符串作为主键是否会比数字慢很多?
I'm designing a data table in Access. I have two columns whose values are something like:
col1: CU001-
col2: 03
and i want to join these two string to form another column's default value like: CU001-03
How can i do this?
And one more question is whether using a string as main key tends to be much slower than a numeric?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相当确定(但欢迎更正)您无法使用默认值访问此类内容,但是您可以通过执行类似的操作来获得相同的效果。
如果您有未绑定表单,那么您可以在保存之前设置第三列的值,就像这样的 presto 代码
在 google 上搜索“未绑定表单”以查看未绑定表单的完整示例,如果您仅使用 JET 来存储您的表单数据然后使用DAO而不是ADO,因为它会更快
编辑
我没有读过任何专门关于访问的书籍,但我可以强烈推荐一些对我有帮助的访问网站。这里它们没有特定的顺序
http://www.mvps.org/access/
http://www.granite.ab.ca/access/
http://www.lebans.com/
http://allenbrowne.com/tips.html
还有更多,但它们是一个很好的起点
I’m fairly sure (but open to correction) that you cant have this kind of thing in access using the default value however you can get the same effect by doing something like this.
If you have an unbound form then you can set the value of your 3rd column before you save it like this presto code
Search on “unbound forms” on google to see full examples of unbound forms, also if you are only using JET to store your data then use DAO over ADO as it will be faster
EDIT
I have not read any books specifically on access but I can strongly recommend a few access websites that have helped me. Here they are in no particular order
http://www.mvps.org/access/
http://www.granite.ab.ca/access/
http://www.lebans.com/
http://allenbrowne.com/tips.html
There are many more out there but they are a good place to start