代码如下:
procedure TForm1.Button1Click(Sender: TObject);
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('update temp set ccrmb_new =:nNew where id =:nId') ;
Query1.ParamByName('nNew').AsInteger := 12;
Query1.ParamByName('nId').AsInteger :=1 ;
Query1.ExecSQL;
Query1.Close;
end;
执行时错误信息如下:
Project BOCCCard.exe raised exception class EDBEngineError with message'Type
mismatch in expression.'.Process stopped . Use stop or Run to continue.
修改后,这样就能正确执行,
procedure TForm1.Button1Click(Sender: TObject);
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('update temp set ccrmb_new =12 where id =1') ;
// Query1.ParamByName('nNew').AsInteger := 12;
// Query1.ParamByName('nId').AsInteger :=1 ;
Query1.ExecSQL;
Query1.Close;
end;
两段代码都是一个意思的啊!!!!
procedure TForm1.Button1Click(Sender: TObject);
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('update temp set ccrmb_new =:nNew where id =:nId') ;
Query1.ParamByName('nNew').AsInteger := 12;
Query1.ParamByName('nId').AsInteger :=1 ;
Query1.ExecSQL;
Query1.Close;
end;
执行时错误信息如下:
Project BOCCCard.exe raised exception class EDBEngineError with message'Type
mismatch in expression.'.Process stopped . Use stop or Run to continue.
修改后,这样就能正确执行,
procedure TForm1.Button1Click(Sender: TObject);
begin
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('update temp set ccrmb_new =12 where id =1') ;
// Query1.ParamByName('nNew').AsInteger := 12;
// Query1.ParamByName('nId').AsInteger :=1 ;
Query1.ExecSQL;
Query1.Close;
end;
两段代码都是一个意思的啊!!!!
解决方案 »
- RTTI怎么获取类中的类信息?
- 关于select语句的简单问题
- 我要打印image1,在FastReport中放了一个picture框,如何才能预览并打印,我用的是fr3
- 使用CreateProcess,参数前面需要一个空格,怎么办?
- 用TMySql连接MySql数据库,取数据可以了,在向MySql中写数据却不知道怎么做了,哪位知道呀
- ShowReportByDataSet(DataSet,Caption);//怎样可以带组件的代码中找到这ShowReportByDataSet的使用说明
- 关于打印机出纸的一个问题
- 用 quickrep都可以把什么打印出来?我把它的dataset谁为table1,运行的时候怎么不见table里的内容呢??
- Database 连接SQlServer不用别名怎么连?
- 很菜的问题,调用CreateOleObject时出错,一定给分.
- 做一个纸牌九点的程序,向个位大虾讨教一下!
- 生日该不该散分????????
Query1.ParamByName('nId').value :=1 ;这样看看可以吗?
Query1.ParamByName('nId').value :=1 ;
Query1.ParamByName('ck_no').Value := 'reet';
可以的,另外考虑一下数据类型。