有一句SQL语句:insert into Netoutput(Ndate,Noutputtype,Noutputmoney,Per,Note) values ('2004-7-5','新浪','254.89','张三','正常支出')在SQL分析器上可以通过。
但是用在delphi上则不行: OADOQuery.Close;
OADOQuery.SQL.Clear;
OADOQuery.SQL.Add('insert into Netoutput(Ndate,Noutputtype,Noutputmoney,Per,Note) values (''2004-7-5'',''新浪'',''254.89'',''聂渊'',''正常支出'')');
OADOQuery.ExecSQL;请问这是为什么?
请各位兄弟帮帮忙。
谢谢!
但是用在delphi上则不行: OADOQuery.Close;
OADOQuery.SQL.Clear;
OADOQuery.SQL.Add('insert into Netoutput(Ndate,Noutputtype,Noutputmoney,Per,Note) values (''2004-7-5'',''新浪'',''254.89'',''聂渊'',''正常支出'')');
OADOQuery.ExecSQL;请问这是为什么?
请各位兄弟帮帮忙。
谢谢!
说的对,
你只能把是字符型的数据用单引号引起来
query.parambyname('parm1').value := ****;
query.parambyname('parm1').value := ****;
兄弟们这几种方法我都用过了:1>delphi重新起动了不知道多少次2>我的确用的是盗版的,在中国有几个用正版的?这真的是盗版引起的吗?3>我开始是用的参数形式:
ADOQuery.parameters.paramByName('netoutputmoney').values:=Edit.Text;
(我在这儿大小写没分,但在程序里是好的)
也是上面的一个错误,于是我在sql server写了一个sql语句,通过了。粘贴过来,运行后还是上面那个错误。
大家认为到底是什么原因?