设置两个字段主键
表
1 id1 ==>编号
id2 ==>编号
id 希望 id1 包含唯一编号,id2 包含唯一编号。
如何设置id1和id2主键
?
table1
id1 ==> number
id2 ==> number
id want id1 contain uniqe number and id2 contain unique number.
how can set id1 and id2 primary key
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在表设计器中,选择两行,然后单击工具栏中的主键按钮。
或者,打开查询设计器,将视图更改为 SQL 视图,然后键入以下代码:
然后,单击运行按钮。这将创建一个包含这两个字段的主键。
如果您询问是否在两列中都有自动递增整数字段,则不能。您必须以编程方式执行此操作。 Access(以及大多数其他数据库)只允许每个表有一个“自动编号”字段。
In the Table Designer, Select both rows, and then click the Primary Key button in the Toolbar.
OR, open the Query Designer, change the view to SQL View, and type the following code:
Then, hit the run button. This will create a Primary key which includes both of those fields.
If you are asking about having an Auto-incrementing integer field in both columns, you can't. You would have to do that programmatically. Access (and most other db's) only allow one "autonumber" field per table.