Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records based on ADODB recordset not updatable

Status
Not open for further replies.

cbirknh

Programmer
Jun 28, 2002
14
US
Hi,
I have a continuous form (developed within an Access Data Project .adp) which is based on an ADODB recordset (view code at bottom). I have had no difficulties viewing and editing forms populated with this method on my desktop computer, but when I installed the application on my laptop, I found that records on these continuous forms could no longer by modified; I am getting the error message "Field 'weight' is based on an expression and can't be edited". Both computers have Windows 2000 and are running Access 2002; what could be different on these two machines?

Thank you,
Chris


Public Sub SubformRecordSource()
On Error GoTo ErrorHandler

Dim intResponse As Integer

Dim cnn As ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset
Dim prm1 As ADODB.Parameter
Dim frm As Form

Set cnn = Application.CurrentProject.Connection
Set cmd.ActiveConnection = cnn

'----- Input Parm
Set prm1 = cmd.CreateParameter("Input", adInteger, adParamInput)
cmd.Parameters.Append prm1
prm1.Value = gblGroupID

' Set up a command object for the stored procedure and execute
cmd.CommandText = "dbo.spSupportGroupAttendees"
cmd.CommandType = adCmdStoredProc

With rst
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open cmd, Options:=adCmdStoredProc
End With

If rst.EOF Then
Me.Detail.Visible = False
Else
Me.Detail.Visible = True
Set frm = Me.Form
Set frm.Recordset = rst
End If

Set prm1 = Nothing
Set cmd = Nothing
Set rst = Nothing
Set cnn = Nothing


ExitHandler:
Exit Sub

ErrorHandler:
intResponse = MsgBox("An error has occurred. Please contact your database administrator with specifics about the incident and this error code: " & Err.Number & " (" & Err.Description & ")", vbOKOnly, "Bariatric Program Registry")
Resume ExitHandler
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top