recordset not updatable

  • Thread starter Thread starter ringo
  • Start date Start date
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
 
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
 
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
 
Back
Top