有一个表User  里面有一个字段,字段名为Employee(数字类型)int aa=1(整型变量aa,初始值赋为1)
1.update  User  set   Employee=1;2.update  User  set   Employee=aa;上面这两条语句,第一条语句执行有用,而第二条语句执行时就出错出错提示好像是说"期待参数为1"请问这是什么原因

解决方案 »

  1.   

    Employee(数字类型)
    Employee=aa; 是个字符串
      

  2.   

    "update  User  set   Employee=" + aa ;
      

  3.   

    strsql.Format("update  User  set   Employee=%d",aa);m_pRecordset->Open((_variant_t)strsql,
    theApp.m_pConnection.GetInterfacePtr(),
    adOpenDynamic,
    adLockOptimistic,
    adCmdText);
      

  4.   

    strSQL = Format(""update  User  set   Employee=%d",aa);
      

  5.   

    int aa = 1;
    strsql.Format("update  User  set   Employee=%d",aa);
    最好别用数字型,容易出错,用字符串做字段,转换一下最保险。