insert and autonumber

G

Guest

I want to insert into a table but the first field is an autonumber, which is
fine.

But I don't want to insert the autonumber

the table looks like this:

ID name address

Id is autonumber but I just want to throw name and address in. how do I go
about it

insert into person
values(?,?)

above brings an error, as its expecting 3 values.
Perhaps there is no way around it besides reading the last autonumber and
inserting id+1 ???

Thanks.
 
D

Douglas J. Steele

INSERT INTO Person (Name, Address)
VALUES (?, ?)

By the way, in case this wasn't just a pretend example, Name is not a
particularly good name to use, as it's a reserved word.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top