下面的代码运行时,出现错误:
'update tmh set dtmh='''+trim(Edit16.Text)+''' where id=''+did+'''
报错如下:
提示:Project P_Tcb.exe raise exception class EOLeException with message'标准表达式中数据类型不匹配。'.Precess stopped.Use Step or Run to continue
id是整数类型
其他方面都能正常运行有楼主回复用where id='+did
delphi无法编译,提示如下:
[Error] U_txmdy.pas(546): Incompatible types: 'String' and 'Integer'同样,语句sql.Add('update tmh set dtmh='''+trim(Edit16.Text)+''' where id='+did+'');在编译时也有以上提示

解决方案 »

  1.   

    id是字符行吗,不是就别加引号,dtmh也是类似道理where id='+did
      

  2.   

    id是整数类型,那did是什麼類型?
    整型:id='+IntToStr(did)
    字符型:id='+did
      

  3.   

    这问题怎么又粗线了,上一贴不是回答过了么?
    http://topic.csdn.net/u/20111027/15/da20addc-144b-4e82-ad4d-3a82f71970de.html
    查查字段类型
      

  4.   

    我靠,分还是要靠我来拿,呵呵'update tmh set dtmh='''+trim(Edit16.Text)+''' where [id]='+did如果did是数字那么
    'update tmh set dtmh='''+trim(Edit16.Text)+''' where [id]='+IntToStr(did)