asp插入ACCESS数据库表的ID递增出错?

来源:百度知道 编辑:UC知道 时间:2024/05/14 03:09:28
<!--#include file="../include/conn1.asp"-->
<%
strsql="create table hero (id INT not null IDENTITY(1,1))"
conn.Execute(strsql)
去掉IDENTITY(1,1)这句能正常插入,加上就无法插入
无法插入,郁闷,是不是无法在ACCESS中使用IDENTITY(1,1)呢?

strsql="create table hero (id INT not null autoincrement)"
就可以了

IDENTITY(1,1)
是表示是一个step=1递增的数,这一列是自动添加的,表示自动编号列,所以是不允许添加数据 的~~~~~