G
Guest
I have an access 2000 project and sql server 2000. On the sql server there is
a complex stored procedure downloading records to a subform. How can I make
the data on the subform updateable? Here is my code:
Dim PLonnraltVer As New ADODB.Parameter, PLRNR As New ADODB.Parameter, RS As
New ADODB.Recordset
Dim CMD As New ADODB.Command
CMD.ActiveConnection = CurrentProject.Connection
CMD.CommandType = adCmdStoredProc
CMD.CommandText = "dbo.lpsp_LonnramAltSelect"
Set PLonnraltVer = CMD.CreateParameter("Lonnralt_ver", adInteger,
adParamInput, , Me.txtlonnramver)
CMD.Parameters.Append PLonnraltVer
Set PLRNR = CMD.CreateParameter("lr_nr", adInteger, adParamInput, ,
Rammenr)
CMD.Parameters.Append PLRNR
Set RS = CMD.Execute
Set Me.SF.Form.Recordset = RS
SF is the name of the subform. The stored procedure, lpsp_LonnramAltSelect,
is makes use of "select case" and "group by". There is no primary key
available in the recordset, and the recordset on the datasheet becomes
not-updateable.
What I would like to do is to supply values into the datasheet subform, let
the operator edit values all over the datasheet and then press a button to
update the sql server tables using a stored procedure. How can I do this? I
have tried variations of unbound controls on the datasheet and ado recordsets
but so far without any success.
Regards
Tore
a complex stored procedure downloading records to a subform. How can I make
the data on the subform updateable? Here is my code:
Dim PLonnraltVer As New ADODB.Parameter, PLRNR As New ADODB.Parameter, RS As
New ADODB.Recordset
Dim CMD As New ADODB.Command
CMD.ActiveConnection = CurrentProject.Connection
CMD.CommandType = adCmdStoredProc
CMD.CommandText = "dbo.lpsp_LonnramAltSelect"
Set PLonnraltVer = CMD.CreateParameter("Lonnralt_ver", adInteger,
adParamInput, , Me.txtlonnramver)
CMD.Parameters.Append PLonnraltVer
Set PLRNR = CMD.CreateParameter("lr_nr", adInteger, adParamInput, ,
Rammenr)
CMD.Parameters.Append PLRNR
Set RS = CMD.Execute
Set Me.SF.Form.Recordset = RS
SF is the name of the subform. The stored procedure, lpsp_LonnramAltSelect,
is makes use of "select case" and "group by". There is no primary key
available in the recordset, and the recordset on the datasheet becomes
not-updateable.
What I would like to do is to supply values into the datasheet subform, let
the operator edit values all over the datasheet and then press a button to
update the sql server tables using a stored procedure. How can I do this? I
have tried variations of unbound controls on the datasheet and ado recordsets
but so far without any success.
Regards
Tore