recordset not updatable

R

ringo

Salve a tutti,

I make a recordset rsSCADENZE and I connect to a form it. My problem is that
the recordset is not updatable..what is the reason?


cmd.CommandType = adCmdStoredProc
cmd.CommandText = "cerca_scadenze_cliente"
cmd.Parameters.Append cmd.CreateParameter("@parametro_cliente", adChar,
adParamInput, 6, cliente_ricerca)
cmd.ActiveConnection = Application.CurrentProject.Connection

Set rsSCADENZE = cmd.Execute

rsSCADENZE.MoveFirst

stDocName = "carico_dati"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Set Forms!carico_dati.Form.Recordset = rsSCADENZE


thanks

ringo
 
J

James Goodman

You are setting the recordset to a stored procedure. An sp is like a
snapshot of the data, & is subsequently not updateable. A similar view might
support updating...

Alternatively, create a paramterized sp which actually updates teh data, &
execute this...

e.g.

CREATE PROCEDURE SomeProc (@SomeVal somedatatype)
AS
UPDATE SomeTable
SET SomeField = @SomeVal
 
J

J. Clay

Why would you not set the form data source in its property window to
cerca_scandnze_cliente and then use inputparameters to define the record(s)
you want. You can always change the inputparameters in code. This is what
they are there for. As long as a primary key is included as part of the
SELECT in the stored procedure, it should be updatable. I use this all of
the time.

HTH,
Jim
 

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