CTime time_end=CTime::GetCurrentTime();filese.Setindexct(time_end);
filese.sql_update_indexct(m_fileNumber);void Cfilese::sql_update_indexct(int Sfileid)
{//插入indexct
ADOConn m_AdoConn;
CString vSQL;
//  CString strStart = indexbt.Format("%Y-%m-%d %H:%M:%S");
//CString strEnd=indexct.Format("%Y-%m-%d %H:%M:%S");
CTime strEnd = indexct;vSQL.Format("update filese set indexct = strEnd");
m_AdoConn.ExecuteSQL(_bstr_t (vSQL));}我的indexct是CTime格式的。。每次运行都提示“列名strEnd无效”,请问这是怎么回事?

解决方案 »

  1.   

    vSQL.Format("update filese set indexct = strEnd");
    改成 vSQL.Format("update filese set indexct = 'strEnd'");之后提示从“字符串转换为CTime失败”
      

  2.   

    CString UpdateSQL;
    UpdateSQL.Format(("update filese set indexct = '%s'",strEnd);vSQL.Format(UpdateSQL);
      

  3.   

    错了,是vSQL.Format(("update filese set indexct = '%s'",strEnd);