bradmaunsell
Programmer
I'm new with SQL 2005 Express and I'm stuck - again
Windows XP
Access 2003
Access Project (on my laptop)
I am re-writing a fairly large application.
I have a problem with stored procedures. More specifically, I cannot change data when I run a stored procedure (used as RecordSource). The form has a header and multiple record detail section (continuous forms). For example, a policyholder header and a detail section with all of the policyholder's endorsements.
My form displays all data corretly but I cannot change any data.
After thrashing around for several hours, I have discovered the problem has nothing to do with my front end. If I run the stored procedure in the SQL Manager, I still cannot edit data. I can edit table data and edit view data but not any data returned from running a stored procedure. At first I looked for a non-updatable select statment but that is not the problem either.
Here is a very simple example. If I run this in the SQL Manager, the data returned is correct but I cannot change anything. It can't get much simpler than this sp.
----------------------------------------------------------
USE [MGA]
GO
/****** Object: StoredProcedure [dbo].[sp_cbo_Staff] Script Date: 12/04/2007 16:32:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Brad Maunsell
-- Create date: 11/06/2007
-- Description: Used for drop downs on underwriters form
-- =============================================
ALTER PROCEDURE [dbo].[sp_cbo_Staff]
AS
BEGIN
SET NOCOUNT ON;
SELECT TOP (100) PERCENT tblStaff.StaffID, tblStaff.Initials,
tblStaff.FirstName, tblStaff.LastName,tblStaff.IsUnderwriter
FROM tblStaff
ORDER BY LastName
END
----------------------------------------------------------
Any help will be greatly appreciated.
Thanks,
Brad
Burlingon, Vermont
Windows XP
Access 2003
Access Project (on my laptop)
I am re-writing a fairly large application.
I have a problem with stored procedures. More specifically, I cannot change data when I run a stored procedure (used as RecordSource). The form has a header and multiple record detail section (continuous forms). For example, a policyholder header and a detail section with all of the policyholder's endorsements.
My form displays all data corretly but I cannot change any data.
After thrashing around for several hours, I have discovered the problem has nothing to do with my front end. If I run the stored procedure in the SQL Manager, I still cannot edit data. I can edit table data and edit view data but not any data returned from running a stored procedure. At first I looked for a non-updatable select statment but that is not the problem either.
Here is a very simple example. If I run this in the SQL Manager, the data returned is correct but I cannot change anything. It can't get much simpler than this sp.
----------------------------------------------------------
USE [MGA]
GO
/****** Object: StoredProcedure [dbo].[sp_cbo_Staff] Script Date: 12/04/2007 16:32:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Brad Maunsell
-- Create date: 11/06/2007
-- Description: Used for drop downs on underwriters form
-- =============================================
ALTER PROCEDURE [dbo].[sp_cbo_Staff]
AS
BEGIN
SET NOCOUNT ON;
SELECT TOP (100) PERCENT tblStaff.StaffID, tblStaff.Initials,
tblStaff.FirstName, tblStaff.LastName,tblStaff.IsUnderwriter
FROM tblStaff
ORDER BY LastName
END
----------------------------------------------------------
Any help will be greatly appreciated.
Thanks,
Brad
Burlingon, Vermont