在SQL2005里可以执行,在VFP用SPT过不去?
SQL 2005update jbqk set bz_jbyal=a.bz_jbyal,jfgz=a.jfgz,sbgz=a.sbgz
from (Select shbzh,bz_jbyal,jfgz,sbgz
From openrowset('MSDASQL','Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=D:\shbxsys\shbx\','select shbzh,bz_jbyal,jfgz,sbgz from x_zgjb')) a
where jbqk.shbzh=a.shbzh collate Chinese_PRC_CS_AI
VFP9
csql=[update jbqk set bz_jbyal=a.bz_jbyal,jfgz=a.jfgz,sbgz=a.sbgz ]
csql=csql+[from (Select shbzh,bz_jbyal,jfgz,sbgz From openrowset('MSDASQL',]
csql=csql+['Driver=Microsoft Visual FoxPro Driver;SourceType=DBF;SourceDB=D:\shbxsys\shbx\',]
csql=csql+['select shbzh,bz_jbyal,jfgz,sbgz from x_zgjb')) a ]
csql=csql+[where jbqk.shbzh=a.shbzh collate Chinese_PRC_CS_AI]
?SQLEXEC(oapp.nconnect,csql)
原来用的是SQL2000 上面VFP9里的代码是可以通过的.
什么原因?
[ 本帖最后由 sdj_2003 于 2010-3-2 15:53 编辑 ]