我在编写代码的时候出现以下问题,恳请各位老师指点!我用的是VC++2005
voidCCzyxxb::sql_delete(CStringcCzyName){ADOConnm_AdoConn;m_AdoConn.OnInitADOConn();C...
void CCzyxxb::sql_delete(CString cCzyName)
{
ADOConn m_AdoConn;
m_AdoConn.OnInitADOConn();
CString sql;
sql.Format("delete from Czyxxb where CzyName='%s'",cCzyName);
m_AdoConn.ExecuteSQL((_bstr_t)sql);
m_AdoConn.ExitConnect();
}
当编译到上面一段程序时出现以下错误。恳请各位大侠指点
1>f:\12l\gzgl\gzgl\czyxxb.cpp(49) : error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const char [46]' (or there is no acceptable conversion)
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsimpstr.h(666): could be 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &,const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsimpstr.h(677): or 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &,const wchar_t *)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsimpstr.h(688): or 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const wchar_t *,const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(2289): or 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,const ATL::CStringT<BaseType,StringTraits> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(2298): or 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,const wchar_t *)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(2307): or 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const wchar_t *,const ATL::CStringT<BaseType,StringTraits> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
.... 展开
{
ADOConn m_AdoConn;
m_AdoConn.OnInitADOConn();
CString sql;
sql.Format("delete from Czyxxb where CzyName='%s'",cCzyName);
m_AdoConn.ExecuteSQL((_bstr_t)sql);
m_AdoConn.ExitConnect();
}
当编译到上面一段程序时出现以下错误。恳请各位大侠指点
1>f:\12l\gzgl\gzgl\czyxxb.cpp(49) : error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const char [46]' (or there is no acceptable conversion)
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsimpstr.h(666): could be 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &,const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsimpstr.h(677): or 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &,const wchar_t *)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsimpstr.h(688): or 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const wchar_t *,const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(2289): or 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,const ATL::CStringT<BaseType,StringTraits> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(2298): or 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,const wchar_t *)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(2307): or 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const wchar_t *,const ATL::CStringT<BaseType,StringTraits> &)' [found using argument-dependent lookup]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
.... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询