ADODB.Connection
(1)
ADODB.Recordset
(1)
ADODB
(1)
VBA
(1)
MsDataShape
(1)
AdLockOptimistic
(1)
AdUseClient
(1)
AdVarChar
(1)

How to update MsDataShape/NEW field in forms

Asked By Walter Guyer
05-Nov-09 02:20 PM
Trying to update a virtual NEW field from a shaped (ADO-) recordset in forms
results in an error: "Field [fieldname] is based on an expression and cannot
be modified.
Similarly, on a virtual table from all NEW fields, forms does not allow for
any new records.
To be mentionned, updates and inserts (AddNew) in VBA works fine on the same
recordsets.

Does anyone knows of some options which might make forms  to feed through
the updates/inserts?

Code used (example):
Private rst As New ADODB.Recordset
Private cnx As New ADODB.Connection
Private Sub Form_Load()
Const strSQL = "SHAPE TABLE Person_B " & _
'Vaiation for a all virtual table
'Const strSQL = "SHAPE APPEND NEW adVarChar (32) AS Familyname, " & _
cnx.Provider = "MSDataShape"
cnx.Open "Data Provider=Microsoft.ACE.OLEDB.12.0;" & _
rst.CursorLocation = adUseClient
rst.Open strSQL, cnx, adOpenForwardOnly, adLockOptimistic
Set Me.Recordset = rst
End Sub
Post Question To EggHeadCafe