Autonumber

bloukewer

Well-known member
Joined
Jul 2, 2004
Messages
88
Programming Experience
3-5
I'm having one helluva struggle trying to figure out how to insert a new record into a table with an autonumber field. If someone could just copy-and-paste an example of a oledbcommand.commandtext that does this it would be much appreciated. I know I saw it somewhere on this discussions but alas, I can't find it.

Also, a question. Is it possible to put two Insert-statements into one command object ?
 
To insert a new record into a table with an autonumber field, you create a standard INSERT statement and leave out the field that has the type autonumber (include all fields except the autonumber field). The database will automaically add the next number to the autonumber field within the record.

Using two INSERT statements is similar to what MZIM has shown with the SELECT statements; use a semicolon between the two INSERT statements.
 
Last edited:
Thank you very much.

Reality is an illusion - But illusions are also a reality...
 
Back
Top