我用APPWIZARD做一个基于对话框的程序,想要连接数据库,在没连接数据库的时候界面能出来,可是只要添加了下面的代码
_ConnectionPtr dataconn;
dataconn.CreateInstance(__uuidof(Connection));
_bstr_t strConnect="Provider=SQLOLEDB; Server=LOUYUANZHI;Database=test; uid=sa; pwd=12345";
dataconn->Open(strConnect,"","",-1);
编译连接都能通过,可是一运行就会出现一个 Runtime Error:
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. 问题出在哪儿?
_ConnectionPtr dataconn;
dataconn.CreateInstance(__uuidof(Connection));
_bstr_t strConnect="Provider=SQLOLEDB; Server=LOUYUANZHI;Database=test; uid=sa; pwd=12345";
dataconn->Open(strConnect,"","",-1);
编译连接都能通过,可是一运行就会出现一个 Runtime Error:
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. 问题出在哪儿?
解决方案 »
- 关于MFC与数据库的结合,谢谢各位大侠。
- c++/MFC vs c#.net 我看他们的优势 !!!
- Windows2000下如何获取某用户文档的路径?
- 帮忙!!!!!!!!
- 一个控制台程序,比较菜,帮忙看看,:)
- 关于重写的CView
- 大家来分析分析这个类是怎样工作的?(CEditEx)我编译它成功,但总觉得它怪怪的!
- 创建线程 传递this指针的问题
- 在MFC和Socket API异步编程里,有很多的消息,都需要手工加入消息响应吗?有的还要加入自定义消息,有没有更简单的方法.
- 关于VC调试的问题
- 求救——小程序修改中需要实现一个最小化当前文档窗口并激活下一个窗口的功能!
- VC中如何创建文件夹,并在文件夹中生成名为tmp.txt的文件?
看看,可能有帮助.
这个函数没有调用吧.