-
Returning the DB Key immediately after Add in EP
This item has appeared before "Returning the DB Key immediately after Add in EP", but back then no answers/solution was found. Is there someone who knows how to get the record ID for an entry made in a table right after you have added this record.
would really help me
Thanks,
Lennart
-
Returning the DB Key immediately after Add in EP (reply)
Lennart,
Is this SQL Server? If so, use the new @@keyword feature. It's very new and we don't have any examples yet, but I'll try to find some doc on it. Try USIntertech's site. It should be doc'd there.
Mark.
------------
lennart at 2/15/01 7:39:27 PM
This item has appeared before "Returning the DB Key immediately after Add in EP", but back then no answers/solution was found. Is there someone who knows how to get the record ID for an entry made in a table right after you have added this record.
would really help me
Thanks,
Lennart
-
Returning the DB Key immediately after Add in EP (reply)
Try the following ->
10.23.00
* Support SELECT Edit@@??? after MS-SQL edit action. dbEditParams="Edit@@=action_key_word|Variable_ Name|Repeat..."
User specify the variable name(s) and SELECT @@keyword as 'xxx' will be executed after the edit action
(like INSERT / UPDATE) and a session variable of the user specified name plus the dbUnit will be retuned.
User is responsible whether this action retrival is appropriate by specifying this option. To retrieve the variable, use
session(aspdb_variable_name_sx). If variable name is blank then it is the same as the keyword like session("aspdb_IDENTITY_999".
<%
Set x = server.CreateObject("ASP.DB"
x.dbUnit = "999"
x.dbMode = "Grid"
x.dbDBType = "MSSQL"
x.dbDSN = "Driver={SQL Server}; Database=pubs; UID=sa; Server=dell7500"
x.dbEditAddROFlds = "job_id"
x.dbEditFlds = "(;,[]|)job_desc, min_lvl, max_lvl"
x.dbEditParams = "(;,)TableName=jobs, BookMarkFlds=job_id, Edit@@=identity|AddID"
x.dbEditUpdateROFlds = "job_id"
x.dbEditAddROFlds = "job_id"
x.dbNavigationItem = "Top,Prev,Next,Bottom,GridRow,Reload,Edit,Upda te,Delete,Add"
x.dbSQL = "SELECT job_id,job_desc,min_lvl,max_lvl FROM jobs"
x.aspdb
Response.Write ("IDENTITY=" & Session("aspDB_AddID_999")
%>
------------
Mark at 2/15/01 9:43:14 PM
Lennart,
Is this SQL Server? If so, use the new @@keyword feature. It's very new and we don't have any examples yet, but I'll try to find some doc on it. Try USIntertech's site. It should be doc'd there.
Mark.
------------
lennart at 2/15/01 7:39:27 PM
This item has appeared before "Returning the DB Key immediately after Add in EP", but back then no answers/solution was found. Is there someone who knows how to get the record ID for an entry made in a table right after you have added this record.
would really help me
Thanks,
Lennart
-
Returning the DB Key immediately after Add in EP (reply)
Lennart,
If you want to see how to determine the ID of a newly added record, see Miscellaneous Example 8 at:
http://www.aspdb.com/UNO
Mark.
------------
Frank Kwong at 2/16/01 1:37:22 AM
Try the following ->
10.23.00
* Support SELECT Edit@@??? after MS-SQL edit action. dbEditParams="Edit@@=action_key_word|Variable_ Name|Repeat..."
User specify the variable name(s) and SELECT @@keyword as 'xxx' will be executed after the edit action
(like INSERT / UPDATE) and a session variable of the user specified name plus the dbUnit will be retuned.
User is responsible whether this action retrival is appropriate by specifying this option. To retrieve the variable, use
session(aspdb_variable_name_sx). If variable name is blank then it is the same as the keyword like session("aspdb_IDENTITY_999".
<%
Set x = server.CreateObject("ASP.DB"
x.dbUnit = "999"
x.dbMode = "Grid"
x.dbDBType = "MSSQL"
x.dbDSN = "Driver={SQL Server}; Database=pubs; UID=sa; Server=dell7500"
x.dbEditAddROFlds = "job_id"
x.dbEditFlds = "(;,[]|)job_desc, min_lvl, max_lvl"
x.dbEditParams = "(;,)TableName=jobs, BookMarkFlds=job_id, Edit@@=identity|AddID"
x.dbEditUpdateROFlds = "job_id"
x.dbEditAddROFlds = "job_id"
x.dbNavigationItem = "Top,Prev,Next,Bottom,GridRow,Reload,Edit,Upda te,Delete,Add"
x.dbSQL = "SELECT job_id,job_desc,min_lvl,max_lvl FROM jobs"
x.aspdb
Response.Write ("IDENTITY=" & Session("aspDB_AddID_999")
%>
------------
Mark at 2/15/01 9:43:14 PM
Lennart,
Is this SQL Server? If so, use the new @@keyword feature. It's very new and we don't have any examples yet, but I'll try to find some doc on it. Try USIntertech's site. It should be doc'd there.
Mark.
------------
lennart at 2/15/01 7:39:27 PM
This item has appeared before "Returning the DB Key immediately after Add in EP", but back then no answers/solution was found. Is there someone who knows how to get the record ID for an entry made in a table right after you have added this record.
would really help me
Thanks,
Lennart
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|