| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1315 人关注过本帖
标题:求教:关于多表视图更新原数据表的问题
只看楼主 加入收藏
jsfchqf
Rank: 1
等 级:新手上路
帖 子:34
专家分:0
注 册:2006-8-19
结帖率:50%
收藏
已结贴  问题点数:20 回复次数:1 
求教:关于多表视图更新原数据表的问题
vfp9.0中,使用create sql view 创建一个多表视图,当修改数据后移动到下一个记录时,提示“未指定要更新表,请使用临时表的Tables属性”的错误,无法实现原表数据的更新。因为表数据是按月动态的,所以我对数据表名使用了宏替换。具体语句如下:
  fkq='kq_'+tmp_year+tmp_month
  fjj='jj_'+tmp_year+tmp_month

cbmdm=SUBSTR(ALLTRIM(thisform.treeview1.selectedItem.Text),1,5)
CREATE SQL VIEW kq_jj as select kq.gh,kq.name,kq.bmdm,kq.ycq,kq.scq,kq.dlts,jj.ccjj,jj.zljp,jj.gwjt,jj.gh gh1 from &fkq kq left join &fjj jj on kq.gh=jj.gh order by kq.bmdm,kq.gh where kq.bmdm=cbmdm
DBSETPROP("kq_jj","view","SendUpdates",.T.)
DBSETPROP("kq_jj","view","BatchUpdateCount",1)
DBSETPROP("kq_jj","view","CompareMemo",.T.)
DBSETPROP("kq_jj","VIEW","FetchAsNeeded",.F.)
DBSETPROP("kq_jj","VIEW","FetchMemo",.T.)
DBSETPROP("kq_jj","VIEW","FetchSize",100)
DBSETPROP("kq_jj","VIEW","MaxRecords",-1)
DBSETPROP("kq_jj","VIEW","Prepared",.F.)
DBSETPROP("kq_jj","VIEW","UpdateType",1)
DBSETPROP("kq_jj","VIEW","UseMemoSize",255)
DBSETPROP("kq_jj","VIEW","Tables","&fkq,&fjj")
DBSETPROP("kq_jj","VIEW","WhereType",3)


DBSETPROP("kq_jj.gh","FIELD","DataType","c(8)")
DBSETPROP("kq_jj.gh","FIELD","UpdateName","&fkq.gh")
DBSETPROP("kq_jj.gh","FIELD","KeyField",.T.)
DBSETPROP("kq_jj.gh","FIELD","Updatable",.F.)

DBSETPROP("kq_jj.gh1","FIELD","DataType","c(8)")
DBSETPROP("kq_jj.gh1","FIELD","UpdateName","&fjj.gh")
DBSETPROP("kq_jj.gh1","FIELD","KeyField",.T.)
DBSETPROP("kq_jj.gh1","FIELD","Updatable",.F.)

DBSetProp("kq_jj.name","Field","DataType","C(6)")
DBSetProp("kq_jj.name","Field","UpdateName","&fkq.name")
DBSetProp("kq_jj.name","Field","KeyField",.F.)
DBSetProp("kq_jj.name","Field","Updatable",.T.)

DBSetProp("kq_jj.bmdm","Field","DataType","C(5)")
DBSetProp("kq_jj.bmdm","Field","UpdateName","&fkq.bmdm")
DBSetProp("kq_jj.bmdm","Field","KeyField",.F.)
DBSetProp("kq_jj.bmdm","Field","Updatable",.T.)

DBSetProp("kq_jj.ycq","Field","DataType","N(4,1)")
DBSetProp("kq_jj.ycq","Field","UpdateName","&fkq.ycq")
DBSetProp("kq_jj.ycq","Field","KeyField",.F.)
DBSetProp("kq_jj.ycq","Field","Updatable",.T.)

DBSetProp("kq_jj.scq","Field","DataType","N(4,1)")
DBSetProp("kq_jj.scq","Field","UpdateName","&fkq.scq")
DBSetProp("kq_jj.scq","Field","KeyField",.F.)
DBSetProp("kq_jj.scq","Field","Updatable",.T.)

DBSetProp("kq_jj.dlts","Field","DataType","N(4,1)")
DBSetProp("kq_jj.dlts","Field","UpdateName","&fkq.dlts")
DBSetProp("kq_jj.dlts","Field","KeyField",.F.)
DBSetProp("kq_jj.dlts","Field","Updatable",.T.)

DBSetProp("kq_jj.ccjj","Field","DataType","N(12,2)")
DBSetProp("kq_jj.ccjj","Field","UpdateName","&fjj.ccjj")
DBSetProp("kq_jj.ccjj","Field","KeyField",.F.)
DBSetProp("kq_jj.ccjj","Field","Updatable",.T.)

DBSetProp("kq_jj.zljp","Field","DataType","N(8,2)")
DBSetProp("kq_jj.zljp","Field","UpdateName","&fjj.zljp")
DBSetProp("kq_jj.zljp","Field","KeyField",.F.)
DBSetProp("kq_jj.zljp","Field","Updatable",.T.)

DBSetProp("kq_jj.gwjt","Field","DataType","N(8,2)")
DBSetProp("kq_jj.gwjt","Field","UpdateName","&fjj.gwjt")
DBSetProp("kq_jj.gwjt","Field","KeyField",.F.)
DBSetProp("kq_jj.gwjt","Field","Updatable",.T.)
2016-08-24 14:46
tlliqi
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:204
帖 子:15453
专家分:65956
注 册:2006-4-27
收藏
得分:20 
没看出什么问题
2016-08-24 18:08
快速回复:求教:关于多表视图更新原数据表的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037224 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved