我用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. 问题出在哪儿?