Can't Delete Record

B

Bryan

Hello:

Using a ADP project connected to MSDE. I can delete
records from tables, but can not delete them from the
form. "Records Not Deleted -Record is Read Only"

I have set Allow Additions to true in the form property
to no avail. Any idea what is happening here?
 
B

Bryan

Well, I think I found out what the problem is. I am using
a stored procedure as the forms underlying recordsource.
From what I know understand Stored Procedures are not
updateable.

Or are they and if so how??

If not my only options are to redesign the form or use
code to delete the selected record.
 
G

Guy Horton

Bryan,

You are correct in that Stored Procedures are not updateable, but an ADP
will correctly generate Insert/Update and Delete statements for forms based
on stored procedures under the following circumstances:

1) The user has Insert, Update, Delete permissions on the underlying tables.
2) The stored procedure Select statement contains the primary keys of all
tables involved in the query even if the form doesn't require them
(otherwise a read only recordset will be returned because Access doesn't
have enough information to resolve the unique table and the unique table
won't appear as a selectable item on the form data tab for you to specify in
3)
3) A resync command and the unique table have been specified.

The same applies for views without the view_metadata clause specified,
although, they don't require a resync command unless you want to allow users
to successfully enter records without error when a server filter has been
applied.

If you don't want to give users access to the underlying tables then use a
view with view_metadata (see BOL for more information) specified.

There are other mechanisms you can use, for instance, I believe Vadim Rapp
likes to directly code the Select statement into the recordsource (please
correct me if I am wrong Vadim) rather than create a stored procedure or
view.

Apologies for the rather rushed response please see some of my earlier more
expansive postings on how (my understanding) Access ADP's actually update a
SQL Server database. I only wish Microsoft would issue a white paper on the
subject.

Hope this helps

Cheers
Guy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top