原来这个程序用在ACCESS数据库是没问题的,但是我把这个数据库升级到sql2000后,
运行程序出错提示:
第 1 行: ',' 附近有语法错误
不知为什么?代码如下:
begin
begin
Aqryapp.ExecSQL ;
Aqrylose.ExecSQL ;
if CheckBox1.Checked = true then
begin
ppReport1.ShowPrintDialog := false;
ppReport1.Print;
end;
Aqrydel.ExecSQL ;
Atblstemp.Close ;
atblstemp.Open ; DBEditEh1.Text:=vbmh ;
DBComboBoxEh1.Text:=vlabel;
dbdatetimeediteh1.Value:= vdate;
dbedit2.Text :='1'; qryid;
DBEditEh3.Text := vyyyh;
DBEditEh3.SetFocus;
end;
end;
注释Aqrylose.ExecSQL和Aqrydel.ExecSQL后,就没有问题,不知是不是这两个表的问题?
Aqrylose的SQL属性如下:
UPDATE t_store, t_saletemp SET t_store.dqsl = [t_store].[dqsl]-[t_saletemp].[sl]
WHERE [t_store]![bmh]=[t_saletemp]![bmh] And [t_store]![spbh]=[t_saletemp]![spbh] and [t_store]![clabel]=[t_saletemp]![clabel]
Aqrydel的SQL属性如下:
delete * from t_saletemp
请高手指点,谢谢!!
运行程序出错提示:
第 1 行: ',' 附近有语法错误
不知为什么?代码如下:
begin
begin
Aqryapp.ExecSQL ;
Aqrylose.ExecSQL ;
if CheckBox1.Checked = true then
begin
ppReport1.ShowPrintDialog := false;
ppReport1.Print;
end;
Aqrydel.ExecSQL ;
Atblstemp.Close ;
atblstemp.Open ; DBEditEh1.Text:=vbmh ;
DBComboBoxEh1.Text:=vlabel;
dbdatetimeediteh1.Value:= vdate;
dbedit2.Text :='1'; qryid;
DBEditEh3.Text := vyyyh;
DBEditEh3.SetFocus;
end;
end;
注释Aqrylose.ExecSQL和Aqrydel.ExecSQL后,就没有问题,不知是不是这两个表的问题?
Aqrylose的SQL属性如下:
UPDATE t_store, t_saletemp SET t_store.dqsl = [t_store].[dqsl]-[t_saletemp].[sl]
WHERE [t_store]![bmh]=[t_saletemp]![bmh] And [t_store]![spbh]=[t_saletemp]![spbh] and [t_store]![clabel]=[t_saletemp]![clabel]
Aqrydel的SQL属性如下:
delete * from t_saletemp
请高手指点,谢谢!!
解决方案 »
- 请教有关SQL字段属性!
- DBGRID如何显示字段类型为text的
- 突然遇到这方面问题,请各位帮忙?很急,在线等,解决马上结!!!
- Delphi问题1:不用控件连接MS SQL数据库?
- delphi中如何取得Excel总的数据集的个数
- 如何把一个Component编译成Activex 组件,然后在VC里调用?
- 怎样实现只有某个控件半透明(不是整个窗体半透明)??
- GetHostByAddr的学问,输入IP得到计算机名,怎么用?我怎么老是失败?
- 疯狂的QuickReport,谁碰到过?帮帮我!
- 福利彩票复式投注求一共产生的注数的算法是什么?
- 请教CDate是不可以识别的函数名等问题
- Win98 替换正在使用的文件
应该是
delete from t_saletemp
没有*吧!
SQL 2000的delete语句不能有*,而Access的delete语句可以有也可以没有
UPDATE t_store, t_saletemp SET t_store.dqsl = [t_store].[dqsl]-[t_saletemp].[sl]
WHERE [t_store]![bmh]=[t_saletemp]![bmh] And [t_store]![spbh]=[t_saletemp]![spbh] and [t_store]![clabel]=[t_saletemp]![clabel]
update 后可以是多个表
UPDATE t_store, t_saletemp
SET t_store.dqsl = [t_store].[dqsl]-[t_saletemp].[sl]
WHERE [t_store].[bmh]=[t_saletemp].[bmh]
And [t_store].[spbh]=[t_saletemp].[spbh]
and [t_store].[clabel]=[t_saletemp].[clabel]