>>I wish it was that easy. I have a couple of other cursoradapters on this particular form that use the same where clause (on tables that do NOT have reserved words in them) and they update fine. I did try it after reading your msg though.
>
>
>That works for me:
>
>IF NOT FILE([tblTest.DBF])
> CREATE TABLE tblTest (PK int, Date D, Type I)
> USE
>ENDIF
>
>LOCAL oCA AS CursorAdapter
>oCA = CREATEOBJECT([CursorAdapter])
>WITH oCA AS CursorAdapter
> .SelectCmd = [SELECT * FROM tblTest]
> .Alias = [crsTest]
> .UpdatableFieldList = [Pk, Date, Type]
> .UpdateNameList = [Pk tblTest.Pk, Date tblTest.Date, Type tblTest.Type]
> .SendUpdates = .t.
> .WhereType = 1
> .KeyFieldList = [Pk]
> .DataSourceType = [Native]
> .Tables = [tblTest]
> IF NOT .CursorFill()
> AERROR(aaa)
> MESSAGEBOX(aaa[1,2])
> RETURN
> ENDIF
>ENDWITH
>BROWSE NORMAL
>? [aaaa]
>IF NOT TABLEUPDATE(1, .t., [crsTest])
> AERROR(aaa)
> MESSAGEBOX(aaa[1,2])
> RETURN
>ENDIF
>
>
>As you see I have two fields in that table named DATE and TYPE and I didn't use anything to cover them.
You almost hit the root of the problem.
Add the DESC field and it dies. It will insert OK. It will update any field except DESC. Try updating DESC and you get the syntax error.
code with DESC field added..
IF NOT FILE([tblTest.DBF])
CREATE TABLE tblTest (PK int, Date D, Type I, desc c(50))
*!* CREATE TABLE tblTest (PK int, Date D, Type I)
USE
ENDIF
LOCAL oCA AS CursorAdapter
oCA = CREATEOBJECT([CursorAdapter])
WITH oCA AS CursorAdapter
.SelectCmd = [SELECT * FROM tblTest]
.Alias = [crsTest]
.UpdatableFieldList = [Pk, Date, Type, desc]
*!* .UpdatableFieldList = [Pk, Date, Type]
.UpdateNameList = [Pk tblTest.Pk, Date tblTest.Date, Type tblTest.Type, desc tblTest.desc]
*!* .UpdateNameList = [Pk tblTest.Pk, Date tblTest.Date, Type tblTest.Type]
.SendUpdates = .t.
.WhereType = 1
.KeyFieldList = [Pk]
.DataSourceType = [Native]
.Tables = [tblTest]
IF NOT .CursorFill()
AERROR(aaa)
MESSAGEBOX(aaa[1,2])
RETURN
ENDIF
ENDWITH
BROWSE NORMAL && add few records here, just please add different values in PK field
? [aaaa]
IF NOT TABLEUPDATE(1, .t., [crsTest])
AERROR(aaa)
MESSAGEBOX(aaa[1,2])
RETURN
ENDIF
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________