please help -- inserting with autonumber key (1 Viewer)

shrndegruv

Registered User.
Local time
Today, 02:52
Joined
Sep 8, 2004
Messages
58
Hi all

In my VB code I need to create a row in a table that has an autonumber field as the primary key.

How does one specify that in SQL.

I have the following as my sql -- I dont know what should go in the [autonumber] spot

Code:
"INSERT INTO [WindowCondition](ID, RoomID, UnitNumber, RoomType)" _
                & "VALUES ( [autonumber]," & cID & ", " & uNumber & ", 'Kitchen')"

when I dont specify to insert ID, I get a key violation error.

thanx
 

pdx_man

Just trying to help
Local time
Today, 02:52
Joined
Jan 23, 2001
Messages
1,347
I believe the answer is nothing ... notta:

"INSERT INTO [WindowCondition](RoomID, UnitNumber, RoomType)" _
& "VALUES (" & cID & ", " & uNumber & ", 'Kitchen')"
 

shrndegruv

Registered User.
Local time
Today, 02:52
Joined
Sep 8, 2004
Messages
58
this was never the error in the first place -- it was a relationship problem...
 

Users who are viewing this thread

Top Bottom