我用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. 问题出在哪儿?
解决方案 »
- 看到别人代码里很多用*(float *) 和 (float *),有什么区别,什么时候需要用到这两个呢?
- HttpSendRequest超时(12002)
- 怎么查函数的参数用法,MSDN的说明不详细。
- 请问DLL中怎样使用ADO访问数据库?
- 如何减少CPU的占用率
- 高分求教!!如何在Radio Button的BN_CLICKED事件中调用对话框
- 请问在vc下怎么判断字符串是中文还是英文的?
- 关于GDI和GDI图像填充的问题,请高手赐教!
- 串口接收数据问题 急 请前辈看看 有代码 多谢了
- 打印图形出错,打印机打印出一个黑色矩形框.
- 求救——小程序修改中需要实现一个最小化当前文档窗口并激活下一个窗口的功能!
- VC中如何创建文件夹,并在文件夹中生成名为tmp.txt的文件?
看看,可能有帮助.
这个函数没有调用吧.