Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored proc help PLEASE

Status
Not open for further replies.

M3Fan

Programmer
Dec 28, 2001
73
US
Ok, I checked out the old threads on this topic and couldn't find something exactly like this. I have the following stored proc in SQL 7:
/*
** This procedure inserts a visit record
** and returns the identity key of the new record
*/
create procedure spLogVisit @Visitor_Name varchar(50),
@Visitor_Date datetime,
@NewRecIdent int output
AS
INSERT INTO VRS_Visit (Visitor_Name, Visit_Date) VALUES ( @Visitor_Name , @Visitor_Date )
set @NewRecIdent = @@IDENTITY

GO


All I want to do is pass in the date and username and get back the identity from and ASP page. I have gone to ASPtoday.com and noticed there are like 10 ways of doing this and have wrestled with it for hours. Can someone point me in the right direction please!!! Help! I just want to do this in my ASP:

IdentityVariable = (number returned from SP)
 
Have you tried this:

Code:
strSQL = "EXECUTE PROCEDURE spLogVisit '" & strVisitorName & "', '" & now() & "'"
set conn = server.createobject("ADODB.CONNECTION")
conn.open strConn 'strConn = your connectionstring
strReturn = conn.execute strSQL
conn.close
set conn = nothing

? This is not a bug - it's an undocumented feature...
;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top