与mfc结合使用 [英] combine of access with mfc

查看:96
本文介绍了与mfc结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我尝试使用MFC连接访问权限,
这是示例代码
CString str;
str = _T("Provider = Microsoft.Jet.OLEDB.4.0;"数据源= C:\\ Users \\ User \\ Documents \\ DataBase.mdb;");

有错误,

Hello, i try to connect access using MFC,
here is the sample code
CString str;
str=_T("Provider=Microsoft.Jet.OLEDB.4.0;""Data Source=C:\\Users\\User\\Documents\\DataBase.mdb;");

there is an error,

error C2308: concatenating mismatched strings
1>          Concatenating wide "Provider=Microsoft.Jet.OLEDB.4.0;" with narrow "Data Source=C:\Users\User\Documents\DataBase.mdb;"



谁能告诉我什么是概率?谢谢..



can anyone tell me what is the prob?? thanks..

推荐答案

将str替换为:
replace the str with:
str=_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\User\\Documents\\DataBase.mdb;");


(基本上,从字符串的中间删除")


(basically, remove "" from the middle of the string)


这篇关于与mfc结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆