asp_databases thread: how to create a table with autonumber and primary key?
i use Access2000
my sql statement is like this
strSQL = "CREATE TABLE Janet ([ID] LONG PRIMARY KEY, [NAME]
VARCHAR(50));"
objRS.Open strSQL, objConn
after execute,
i want to insert data:
strSQL = "INSERT INTO Janet([NAME]) VALUES('Smith');"
objRS.Open strSQL, objConn
then a message was appeared:
primary key [ID] cann't contain null value.
i thought primary key field is autonumber automatically.
my question is:
how do we create a autonumber field in primary key?
thanks in advance
|





