首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

~数据库插入的时候提示异常。

2012-10-23 
求助~~数据库插入的时候提示错误。。错误 :raised exception class eoleexception with message ‘应用程序在

求助~~数据库插入的时候提示错误。。
错误 :
raised exception class eoleexception with message ‘应用程序在当前操作中使用了错误类型的值。’

Delphi(Pascal) code
try    ConTemp.BeginTrans;    with DataModule6.qry_DynamicQuery do    begin      Close;      SQL.Text := SQLStr;      ExecSQL;      Close;      SQL.Text := 'INSERT INTO GZ_UpdateLog Values(:p_Text, :p_SQLText, :p_Date, :p_UserID)';      TextTemp := Copy(MessageStr, 7, Length(MessageStr) - 8);      Parameters.ParamByName('p_Text').Value := TextTemp; //string类型,运行到这里出错      Parameters.ParamByName('p_SQLText').Value := SQLStr;      Parameters.ParamByName('p_Date').Value := Dosp_GetSysTime;      Parameters.ParamByName('p_UserID').Value := UserID;      ExecSQL;    end;    ConTemp.CommitTrans;  except    on E: Exception do    begin      ShowMessage(E.Message);      ShowMessage('更新错误,事务回滚!');      ConTemp.RollbackTrans;      WriteWorkLog(E.Message, Dosp_GetSysTime);      Exit;    end;  end;


[解决办法]
1.給一个具体的值试试
Parameters.ParamByName('p_Text').Value :='张三';

2.插入语句加上字段名
INSERT INTO GZ_UpdateLog (F1,F2,...) Values(...)

热点排行