在MFC下操作数据库的SQL语句
CStringstrsql="selectcount(*)from[User]asnumwhereUserId=1111andPwd=111111";m_recordes...
CString strsql ="select count(*) from [User] as num where UserId =1111 and Pwd = 111111";
m_recordest = m_command->Execute((tagVARIANT *)strsql.AllocSysString(),NULL,adCmdText);
这样运行会出错
m_command->CommandText = “select count(*) from [User] as num where UserId =1111 and Pwd = 111111";
m_recordest = m_command->Execute(NULL,NULL,adCmdText);
这样没错 上面的怎么改才对呢 谢了。 展开
m_recordest = m_command->Execute((tagVARIANT *)strsql.AllocSysString(),NULL,adCmdText);
这样运行会出错
m_command->CommandText = “select count(*) from [User] as num where UserId =1111 and Pwd = 111111";
m_recordest = m_command->Execute(NULL,NULL,adCmdText);
这样没错 上面的怎么改才对呢 谢了。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询