|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problems getting new inserted id from Access
<i><b>Originally posted by : Problems getting new inserted id from Access (robert2504@msn.com)</b></i><br />Hello,<br /> I am writing a new record to an access database and would like to show the user the new record id. This was working fine for the few 100 records. It would show the user "Your work order # is 121" but then it got stuck at 138. We are in the 200s and the user still gets the "Your work order # is 138". Did I do something on the server that made this. Does it have something to do with catching. Now if I go in there, I do get the 138# but if I search the database I can see my work order with the correct #. If I list the database I can see the bottom record is 138 and all new records get inserted somewhere in the middle. Does anyone have any idea what is going on.<br /><br />Thanks in advance<br />Robert Hernandez<br />Programmer<br />South Texas Community College<br /><br />http://www.rgvwebs.com<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : </b></i><br /><br /><br /><br />------------<br />Problems getting new inserted id from Access at 12/2/2000 2:19:06 PM<br /><br />Hello,<br /> I am writing a new record to an access database and would like to show the user the new record id. This was working fine for the few 100 records. It would show the user "Your work order # is 121" but then it got stuck at 138. We are in the 200s and the user still gets the "Your work order # is 138". Did I do something on the server that made this. Does it have something to do with catching. Now if I go in there, I do get the 138# but if I search the database I can see my work order with the correct #. If I list the database I can see the bottom record is 138 and all new records get inserted somewhere in the middle. Does anyone have any idea what is going on.<br /><br />Thanks in advance<br />Robert Hernandez<br />Programmer<br />South Texas Community College<br /><br />http://www.rgvwebs.com<br />
|
|
#3
|
|||
|
|||
|
Just wait for a while and the bottom record will have another ID. Looks like you were doing s.th. like MoveLast or Goto LastRecord and at that place sits the ID 138. there is no reliable way (to my knowledge) to get the ID from an Autonumber field except for these two scenarios.
1) The Autonumber field is in a form and bound to the recordset. Then when you add a record this field shows the new ID. 2) In code rs.AddNew MyNewID = rs!ID ... more coding stuff... rs.Update |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Problems getting new inserted id from Access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|