SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 2nd, 2000, 04:19 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
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 />

Reply With Quote
  #2  
Old December 11th, 2000, 03:33 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<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 />

Reply With Quote
  #3  
Old October 14th, 2003, 10:22 AM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Problems getting new inserted id from Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway