我想把  字段‘在职状况’赋值为一个常量‘离职’,可是老是报错,
  我不知道该该加几个逗号。 
cmd1 .CommandText :='update 人事档案 set 在职状况 =''离职''' +'where 档案号= '''+edt1.Text '''';
  cmd1 .Execute ;

解决方案 »

  1.   

    cmd1 .CommandText :='update 人事档案 set 在职状况 =''离职''' +' where 档案号= '' '+edt1.Text '''';
      cmd1 .Execute 
    在where 前加一空格
    Edit1.Text前的引号里加一空格
      

  2.   

    cmd1.CommandText :='update 人事档案 set 在职状况 =''离职'' where 档案号= '+ QuotedStr(edt1.Text);
      

  3.   

    上面最后的空格加错了
    加一个空格就可以了
    只在where前加一个就行了cmd1 .CommandText :='update 人事档案 set 在职状况 =''离职''' +' where 档案号= '''+edt1.Text '''';
      cmd1 .Execute 
    在where 前加一空格
      

  4.   

    cmd1 .CommandText :='update 人事档案 set 在职状况 =''离职''' +' where 档案号= '''+edt1.Text+ '''';//where 前加个空格, edt1.Text后缺个+