Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
I have dropped a TADOStoreProc component on my DataModule and use it as follows:
ALTER PROCEDURE [dbo].[DoesStandardUserExist] -- Add the parameters for the stored procedure here @Username nvarchar(50), @Password nvarchar(50), @UserId integer = null output AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; select @UserId = Users.Id from Users where Users.UserId = @Username and Users.Password = @Password and Users.Status = 'A' -- If the login was found then return 1. if not( @UserId is null) return 1 else return 0 ; END
BUT it appears that only the first time i execute the SP i get the correct return values. After the first successful user/password match the values of @UserID and @Return_Value are always set to the last successful match.
DoesStandardUserExist.Parameters.ParamByName('@UserName').Value := edtUserName.Text ; DoesStandardUserExist.Parameters.ParamByName('@Password').Value := edtPassword.Text ; DoesStandardUserExist.ExecProc ; if not VarIsNull( DoesStandardUserExist.Parameters.ParamByName('@UserId').Value ) then begin
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.