|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
how to retrive just inserted data
When I insert a record into my database, I don't insert the ID field because it's an autonumber and I want the database to generate it right?
Here's my question: Is there a way to have the recordset return that ID, or some other way of getting it with out making another recordset to grab the ID of the record that I just inserted? Thanks in advance. |
|
#2
|
|||
|
|||
|
Here read this...
http://www.aspfaqs.com/webtech/tips/t122600-1.shtml Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
@@identity doesn't work with Access 97 db's afaik.
With most current MS db's, if you use a recordset to do your insert the ID value is immediately available in the recordset itself. Code:
<%
rs.AddNew
rs("col1") = "stuff1"
rs("col2") = "stuff2"
rs.update
NewID = rs("ID")
%>
This usually works. |
|
#4
|
|||
|
|||
|
Does anyone know if the @@Identity works in access 2000? I tried a quick search on the help files, but nothing turned up, and finally I caught out google - doesnt like @@'s before my keyword and so ignores them!
|
|
#5
|
|||
|
|||
|
I use @@identity from asp with A2K based databases. I don't know that I've ever tried from VBA within Access 2K itself.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > how to retrive just inserted data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|