请教这样用CA数据有时不能保存数据是什么问题?
在表单INIT下代码:Public ca
ca=Createobject("CursorAdapter")
With ca
.Alias = 'xsb'
.Datasource=con
.DataSourceType = 'odbc'
.SelectCmd = "select 学号,姓名,语文,数学,英语 from xsb "
.KeyFieldList = '学号'
.Tables = "xsb"
.UpdatableFieldList = "学号,姓名,语文,数学,英语"
.UpdateNameList ="学号 xsb.学号,姓名 xsb.姓名,语文 xsb.语文,数学 xsb.数学,英语 xsb.英语"
.CursorFill()
Endwith
Select xsb
CursorSetProp("buffering",3)
Thisform.Grid1.RecordSource ="xsb"
Thisform.Grid1.ColumnCount =5
Thisform.Grid1.Columns(1).header1.Caption='学号'
Thisform.Grid1.Columns(1).ControlSource='学号'
Thisform.Grid1.Columns(2).header1.Caption='姓名'
Thisform.Grid1.Columns(2).ControlSource='姓名'
Thisform.Grid1.Columns(3).header1.Caption='语文'
Thisform.Grid1.Columns(3).ControlSource='语文'
Thisform.Grid1.Columns(4).header1.Caption='数学'
Thisform.Grid1.Columns(4).ControlSource='数学'
Thisform.Grid1.Columns(5).header1.Caption='英语'
Thisform.Grid1.Columns(5).ControlSource='英语'
修改后保存
Select xsb
Tableupdate(.T.)
有时能保存有时不能,不知道问题出在哪?请老师帮忙指导一下,谢谢