Insert statement problem

Hi,
I have a table called MyTable in which there are three fields

Id, Name, Address

Id is setup as autonumber field in access2003 database.

Now I use ADO.Net in VB.Net to insert a new record in this table.

Problem is since ID is autonumber a statement like this

"Insert into MyTable values( 'SomeName', 'SomeAddress' )"
fails because it expects ID. But if I have to provide the ID myself then what's the point in having autonumebr field?

what am I doing wrong here?
[553 byte] By [venAdder] at [2007-11-19 12:14:05]
# 1 Re: Insert statement problem
Insert into MyTable values( 'SomeName', 'SomeAddress' )

fails because the columns are not specified and Access might think that 'SomeName' should be assigned to 'ID', or that a field is missing.

Therefore you should try

Insert into MyTable(Name, Address) values( 'SomeName', 'SomeAddress' )

And your data will be inserted and a new Id number will automatically be generated.
olivthill at 2007-11-10 3:30:42 >