return (@lnLoginID)
do it likeselect @lnLoginID as loginidand in the SQLExec command, put the result set into a cursor like
=SQLExec(lnConnection, "execute ApplicationLoginInsert1 ?lcParam1", "Curlogin")Curlogin.LoginID will contain the login ID returned by the stored procedure.
lcParam1 = 'MyPCName' =SQLExec(lnConnection, "execute ApplicationLoginInsert1 ?lcParam1")>The corresponding SQL stored procedure, called ApplicationLoginInsert1, looks like this:
CREATE Procedure ApplicationLoginInsert1 @lcParam1 char(128) AS insert into ApplicationLogin (Login_PC) values (@lcParam1) declare @lnLoginID int exec @lnLoginID = Version1.dbo.ApplicationLogin.Login_ID return (@lnLoginID) GO>These procedures work fine, in that a new record is indeed inserted into my SQL Server table. The idea behind @lnLoginID is to return the value of ApplicationLogin.Login_ID, the newly created record, back to VFP. However, all that's ever returned from SQL Server is either 1 or -1.