vc中注册界面验证报错,求高手!!!

来源:百度知道 编辑:UC知道 时间:2024/09/21 17:40:54
我想做一个注册界面,判断要注册的名字是否和数据库的名字重复:代码如下:
(注册界面的编辑框变量名为:m_Username)
m_pRecordset->Open("SELECT * FROM UserB where m_Username='"+ Username +"'",_variant_t((IDispatch*)theApp.m_pConnection,true),adOpenStatic,adLockOptimistic,adCmdText);

报错为:error C2593: 'operator +' is ambiguous

字符串当然没有重载 operator+

类似 "hello world" += "others" 的代码一定编译不过,不过你可以用CString变量代替字符串,比如

CString str = "hello world" ;
str += "others" ;