please help -- inserting with autonumber key

shrndegruv

Registered User.
Local time
Today, 15:28
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
 
I believe the answer is nothing ... notta:

"INSERT INTO [WindowCondition](RoomID, UnitNumber, RoomType)" _
& "VALUES (" & cID & ", " & uNumber & ", 'Kitchen')"
 
this was never the error in the first place -- it was a relationship problem...
 

Users who are viewing this thread

Back
Top Bottom