Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Autonumber from Access DB After Insert 1

Status
Not open for further replies.
Jan 20, 2005
180
US

I am trying to get the autonumber result of a insert statement immediately after I do the statement.

General code

JobInsert.ExecuteNonQuery()
transaction.Commit()

dr = js.ExecuteReader()
jobnumber = dr(0).ToString

The commit does not do the commit fast enough though and my reader returns 0 rows generating an exception.
I have another form that reads the data as well, and if I close the form doing this work fast enough it will not update the other one either.
Ive tried closing the connection and reopening it and a couple other things.

Does anyone know how to go about getting the result more immediate?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top