If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
@@'IDENTITY Object problem - Help!
I'm trying to retrieve the autonumber field after an
insert and have tried the following different versions Set objRecordset = objConnection.Execute("SELECT @@IDENTITY") Set rsNewID = objConnection.Execute("SELECT @@IDENTITY") Set rsNewID = db.OpenRecordset("SELECT @@Identify") Set rsNewID = db.OpenRecordset("GetBookingID") Set rsNewID = commInsert.Execute("SELECT @@IDENTITY") but get either Object Variable or with block variable not set or Object Required. What do I need to do? Thanks |
#2
|
|||
|
|||
@@'IDENTITY Object problem - Help!
See my code posted in the thread "IDENTITY started by Kate about 2 hours
after your thread (in GettingStarted or Queries). -- HTH Van T. Dinh MVP (Access) "Brian" wrote in message ... I'm trying to retrieve the autonumber field after an insert and have tried the following different versions Set objRecordset = objConnection.Execute("SELECT @@IDENTITY") Set rsNewID = objConnection.Execute("SELECT @@IDENTITY") Set rsNewID = db.OpenRecordset("SELECT @@Identify") Set rsNewID = db.OpenRecordset("GetBookingID") Set rsNewID = commInsert.Execute("SELECT @@IDENTITY") but get either Object Variable or with block variable not set or Object Required. What do I need to do? Thanks |
#3
|
|||
|
|||
@@'IDENTITY Object problem - Help!
And, I might add the reason why I spend time in these newsgroup to learn
things. So, ignore my post about the fact that JET does not support identity....I guess since jet 4.0...it does..... Good post Van....and I think that using identity is quite neat..since you then get compatible code between JET and server based code in case of migration down the road....very nice... -- Albert D. Kallal (MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
Thread Tools | |
Display Modes | |
|
|