Hi,
I apologize if this question should be asked within the Access forumn, but I believe the issue is with SQL. I have a back-end SQL DB connected to an Access front-end DB. When the user clicks a button the following stored procedure is run
Which enters the user name and date of the record that is being checked out. The user should then be able to continue to edit the record. When the identical front-end is hooked up to one server the user gets the message that "The data has been changed by another user" (which I don't want) after he changes the first field within the record. I realized that the conflict is because the stored procedure is entering data into the record. But when the front-end is hooked up to another server (running the identical stored procedure off of identical table), no such message appears.
I am attempting to ascertain what I possibly need to change within SQL Server that will allow the user not to get the data has changed message.
Thanks so much for your assistance.
Sydney
I apologize if this question should be asked within the Access forumn, but I believe the issue is with SQL. I have a back-end SQL DB connected to an Access front-end DB. When the user clicks a button the following stored procedure is run
Code:
@RecordType as varchar(25),
@PrimaryKey as varchar(50),
@UserName as varchar(25)
AS
IF @RecordType = 'Parts'
BEGIN
DECLARE @CheckedOutBy as varchar(25)
DECLARE @CheckedOutDate as datetime
SELECT @CheckedOutBy = ISNULL(CheckedOutByUserName,''), @CheckedOutDate = CheckedOutDate
FROM tblParts
WHERE Partscode= @PrimaryKey
IF @CheckedOutBy > ''
IF @CheckedOutBy = @UserName
SELECT 'Success'
ELSE
SELECT 'This record is already checked out by ' + @CheckedOutBy + ' on ' + CONVERT(varchar(25), @CheckedOutDate)
--SELECT 'This record is already checked out by ' + @CheckedOutBy + ' on ' + CONVERT(varchar(25), @CheckedOutDate)
ELSE
BEGIN
UPDATE tblParts
SET CheckedOutByUserName = @UserName,
CheckedOutDate = GETDATE()
WHERE PartsCode = @PrimaryKey
SELECT 'Success'
END
END
Which enters the user name and date of the record that is being checked out. The user should then be able to continue to edit the record. When the identical front-end is hooked up to one server the user gets the message that "The data has been changed by another user" (which I don't want) after he changes the first field within the record. I realized that the conflict is because the stored procedure is entering data into the record. But when the front-end is hooked up to another server (running the identical stored procedure off of identical table), no such message appears.
I am attempting to ascertain what I possibly need to change within SQL Server that will allow the user not to get the data has changed message.
Thanks so much for your assistance.
Sydney