Home > Database > Mysql Tutorial > 在做向Access数据表增加数据时,如何让数据库自增主键?

在做向Access数据表增加数据时,如何让数据库自增主键?

WBOY
Release: 2016-06-07 15:43:40
Original
1193 people have browsed it

我的sql语句是string sqlstr = "insert into PutOption values(@id,@productCode,@productType,@contractMonth,@strikePrice,@reserve,@issueCode,@closingPrice," 我想要的是把@id这个值去掉,让它像在sqlserver里面一样随着 数据 增加 而增长,不用再sql语

我的sql语句是string sqlstr = "insert into PutOption values(@id,@productCode,@productType,@contractMonth,@strikePrice,@reserve,@issueCode,@closingPrice,"

我想要的是把@id这个值去掉,让它像在sqlserver里面一样随着数据增加而增长,不用再sql语句给他指定值

还有疑问就是access中主键也必须给它指定一个值添加到数据库吗,没有id值一直报“字段数不匹配查询的输出”的错误

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template