#include "afxdb.h"
#import "c:\program files\common files\system\ado\msado15.dll " no_namespace rename("EOF","ADOEOF")
if(!AfxOleInit())
::AfxMessageBox("Init OLE failed!");
::CoInitialize(NULL); //初始化COM
_ConnectionPtr mydb;
mydb.CreateInstance(__uuidof(Connection));
mydb->Open("DSN=mysql;uid=sa;pwd=sa","","",0);
#import "c:\program files\common files\system\ado\msado15.dll " no_namespace rename("EOF","ADOEOF")
if(!AfxOleInit())
::AfxMessageBox("Init OLE failed!");
::CoInitialize(NULL); //初始化COM
_ConnectionPtr mydb;
mydb.CreateInstance(__uuidof(Connection));
mydb->Open("DSN=mysql;uid=sa;pwd=sa","","",0);
网上搜索一下,应该有不少。www.google.com.cn