VC调用存储过程出错,各位高手帮看看
try{//初始化数据库连接对象m_pConnection.CreateInstance("ADODB.Connection");//定义数据库连接字符串_bstr_ts...
try
{
//初始化数据库连接对象
m_pConnection.CreateInstance("ADODB.Connection");
//定义数据库连接字符串
_bstr_t strConn="Provider=SQLOLEDB;Server=192.168.4.185;DAATBASE=ryjk;UID=sa;PWD=123;";
//打开数据库连接
m_pConnection->Open(strConn,"","",adModeUnknown);
if (m_pConnection->State == adStateOpen)
{ MessageBox("数据库已连接上"); }
m_pRecordset=NULL;
m_pRecordset.CreateInstance("ADODB.Recordset");
_variant_t vra;
//执行SQL语句
m_pRecordset=m_pConnection->Execute("EXEC backupdata",&vra,adCmdStoredProc);
编译,运行出错IDispatch error #3092
这是什么错误?怎么改? 展开
{
//初始化数据库连接对象
m_pConnection.CreateInstance("ADODB.Connection");
//定义数据库连接字符串
_bstr_t strConn="Provider=SQLOLEDB;Server=192.168.4.185;DAATBASE=ryjk;UID=sa;PWD=123;";
//打开数据库连接
m_pConnection->Open(strConn,"","",adModeUnknown);
if (m_pConnection->State == adStateOpen)
{ MessageBox("数据库已连接上"); }
m_pRecordset=NULL;
m_pRecordset.CreateInstance("ADODB.Recordset");
_variant_t vra;
//执行SQL语句
m_pRecordset=m_pConnection->Execute("EXEC backupdata",&vra,adCmdStoredProc);
编译,运行出错IDispatch error #3092
这是什么错误?怎么改? 展开
1个回答
2010-04-14
展开全部
good
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询