急急!!高分100请高手,少了再加!!
connect using sqlca;
string errors,sql_syntax
string presentation_str,dwsyntax_str
//定义数据窗口的数据来源
sql_syntax="select * from jk order by jk_no"
//定义数据窗口显示字符串
presentation_str="style(type=grid)"
// 得到建立数据窗口对象语法
// 如果错误发生,SyntaxFromSQL 返回一个空字符串
dwsyntax_str=sqlca.syntaxfromsql(sql_syntax,presentation_str,errors)
if len(errors)>0 then
messagebox("error","syntaxfromsql()"+errors)
return
end if
dw_1.create(dwsyntax_str,errors)
if len(errors) >0 then
MessageBox("Error", "Create have these errors: ~r" +errors)
else
dw_1.settransobject(sqlca)
dw_1.retrieve()
//动态设置窗口的taborder:
dw_1.Modify("jk_no.TabSequence='10'")
dw_1.Modify("product_no.TabSequence='20'")
dw_1.Modify("product_number.TabSequence='30'")
dw_1.Modify("jk_manager.TabSequence='40'")
//update属性比较麻烦,因为涉及到修改可更新的表名、主健列和可更新列
//修改可更新的表名
dw_1.Modify("DataWindow.Table.UpdateTable='jk'")
//修改可更新的表名中的主健列
dw_1.Modify("jk.Key=yes")
//修改可更新的表名中的可更新列
dw_1.Modify("jk_no.Update=Yes")
dw_1.Modify("product_no.Update=Yes")
dw_1.Modify("product_number.Update=Yes")
dw_1.Modify("product_indate.Update=Yes")
dw_1.Modify("jk_manager.Update=Yes")
end if
出错信息: 当insert一条记录输入值之后提交之后没有错,
但是,如果一旦直接在grid上修改信息后提交,就有出错信息:读内存出错,或者自动结束程序。