Solved

Returning Identity column value from a stored Procedure via DAO/JET

Posted on 1998-11-05
1
243 Views
Last Modified: 2008-01-09
I am making some modifications to a legacy application which uses DAO/JET to get to the SQL Server database.  I know how to return an Identity column value from an INSERT query using RDO or ODBC Direct, but I cannot determine how to do this using DAO/JET.  Can someone help?

Thanks,

Steve
0
Comment
Question by:SMSatterfield
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
spiridonov earned 50 total points
ID: 1091072
at the end of your stored procedure put SELECT @@identity and call it from Access this way:

dim rs as recordset
dim db as database
.

set rs=db.openrecordset("EXECUTE your_stored_procedure")
ret_Identity=rs.fields(0)
.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question