Arts
Movies ,
Television ,
Music
Business
Jobs ,
Industries ,
Investing
Computers
Internet ,
Software ,
Hardware
Games
Video Games ,
RPGs ,
Gambling
Health
Fitness ,
Medicine ,
Alternative
Home
Family ,
Consumers ,
Cooking
K i d s and Teens
Arts ,
School Time ,
Teen Life
News
Media ,
Newspapers ,
Weather
Reference
Maps ,
Education ,
Libraries
Regional
US ,
Canada ,
UK ,
Europe
Science
Biology ,
Psychology ,
Physics
Sports
Baseball ,
Soccer ,
Basketball
World
Deutsch ,
Español ,
Français ,
Italiano ,
Japanese ,
Nederlands ,
Polska ,
Svenska
Assuming your connection is named Conn, that it is an include file in a
directory for connections, here is the solution for getting the ID. (Go
get a good understanding of how and why to do this. )<%Response.Buffer=TRUE%>
<!-- #Include Virtual="conn_strings/myConn.asp" -->
<%
DIM x_1 ,x_2, uniqueID
x_1 = "something"
x_2 = "something else"
SQL="INSERT INTO myTable ('" & x_1 & "','" & x_2
& "')
Conn.Execute(SQL)
Set RS = Conn.Execute( "SELECT @@IDENTITY" )
myID = RS("ID")
RS.Close
SET RS = NOTHING
Conn.Close
SET Conn = NOTHING
%>
<HTML>
<HEAD>
<TITLE> Get the ID of the record entered. </TITLE>
</HEAD>
<BODY>
The ID number id <%=myID%>
</BODY>
</HTML>
Bad or missing query parameters in request.