CLOSE DATABASES all clear LOCAL oCon as ADODB.Connection, oRS as ADODB.Recordset, oCA as CursorAdapter oCon=CREATEOBJECT("ADODB.Connection") oCon.Open("Provider=SQLOLEDB;Data Source=(local);Trusted_Connection=YES") oCon.Execute("create table #test (f1 int, f2 varchar(10),f3 text)") oCon.Execute("insert into #test values(1,'11111','111111111111111111111111')") oRs=CREATEOBJECT("ADODB.Recordset") oRs.ActiveConnection=oCon oCom=CREATEOBJECT("ADODB.Command") oCom.ActiveConnection=oCon oCA=CREATEOBJECT("CursorAdapter") oCA.DataSourceType="ADO" oCA.DataSource=oRs oCA.UpdateCmdDataSourceType="ADO" oCA.UpdateCmdDataSource=oCom oCA.Tables="#test" oCA.KeyFieldList="f1" oCA.UpdatableFieldList="f2,f3" oCA.UpdateNameList="f1 #test.f1, f2 #test.f2, f3 #test.f3" oCA.SelectCmd="Select * from #test" oCA.BufferModeOverride= 5 oCA.CompareMemo= .F. ?oCA.CursorFill() SELECT (oCA.Alias) LIST GO top REplace f2 WITH '', f3 WITH '' if(!TABLEUPDATE(.T.)) AERROR(aerrors) DISPLAY MEMORY LIKE aerrors ENDIF USE ?oCA.CursorFill() SELECT (oCA.Alias) LIST returnWe will address this issue in the next VFP release. In the mean time, you may use a CursorAdapter.BeforeUpdate event as a workaround:
FUNCTION BeforeUpdate (cFldState, lForce, nUpdateType, cUpdateInsertCmd, cDeleteCmd) *?cUpdateInsertCmd LOCAL cAlias cAlias=ALIAS() SELECT (this.Alias) if(LEN(ProdDescription)=0) cUpdateInsertCmd=STRTRAN(cUpdateInsertCmd,"?"+this.Alias+".ProdDescription","''",1,1,1) *?cUpdateInsertCmd ENDIF SELECT (cAlias) ENDFUNCIt is possible to write generic code to handle all empty character and memo fields.