上,vc用ADO如何连网络数据库

求助下,vc用ADO怎么连网络数据库!
code=c] HRESULT hr;
  _ConnectionPtr m_pConnection;
  try
  {
  hr =m_pConnection.CreateInstance("ADODB.Connection");///创建Connection对象
  if(SUCCEEDED(hr))
  {
  //hr = m_pConnection->Open("Provider=SQLOLEDB;data source=208.81.166.52;Database=wanglou;uid=wanglou;pwd=wanglou;","","",0);///连接数据库
   hr = m_pConnection->Open("provider=sqloledb.1;User ID=wanglou;PWD=wanglou;initial catalog=wanglou;persist security info=false;data source=208.81.166.52;","","",0);

  }
  }
  catch(_com_error e)///捕捉异常
  {
  CString errormessage;
  errormessage.Format("连接数据库失败!\r错误信息:%s",e.ErrorMessage());
  AfxMessageBox(errormessage);///显示错误信息
  } [/code]
上面是我的代码编译运行的时候 是下面的提示[
数据库名和用户密码都是 wanglou 
百度了很久都找不到能用的例子!希望大家能帮下,谢谢  ~!
------最佳解决方案--------------------
是否OLE初始化,就是在工程的初始化函数里执行:AfxInitOle()
------其他解决方案--------------------
以下是我采用ADO连接SQL2000的代码,你参考下:
定义一个
_ConnectionPtr   g_pConnPtr;

if (FAILED(this->g_pConnPtr.CreateInstance("ADODB.Connection")))
{
AfxMessageBox("Create Instance failed!");
return FALSE;
}
this->g_pConnPtr->ConnectionTimeout = 3 ;///创建Connection对象

CString strSRC;
strSRC="Driver=SQL Server;Server=";
strSRC+="SQL服务器名称或是IP地址";
strSRC+=";Database=";
strSRC+="你的数据库名称";

CString temp ; 
temp.Format(";UID=%s ; PWD=%s" , "你的用户名" , "你的密码");
strSRC+= temp ;

_variant_t varSRC(strSRC);
// _variant_t varSQL(strSQL);
_bstr_t bstrSRC(strSRC);

try
{
if (FAILED(this->g_pConnPtr->Open(bstrSRC,"","",-1)))
{
AfxMessageBox("Can not open Database!");
this->g_pConnPtr.Release();
return FALSE;
}
}
catch(_com_error e) 

AfxMessageBox("数据库服务器连接失败!\n1、请确定网络是否通畅;\n2、请确定数据库服务器名称、用户名和密码是否每项都正确;"); 
return FALSE; 

return TRUE ;



------其他解决方案--------------------
用这个软件试试,可以测试获取连接字符串,还能测试SQL。
------其他解决方案--------------------
我以前写过远程连接sql2000。
遇到无法连接的问题,解决办法:
1,sql2000不支持远程连接,需要安装sp4补丁。
2,打开端口
3,客户端需要透过防火墙。