改进后还是错:
m_pCon.CreateInstance(__uuidof(Connection));

CString constring = "Driver={MySQL ODBC 5.14 Driver};Server=localhost;Database=mydb;User=root;Password=admin;Option=4;";//Option=4是什么意思

HRESULT Flag;
try
{
Flag = m_pCon.CreateInstance("ADODB.Connection");//创建Connection对象

if(SUCCEEDED(Flag))
{
MessageBox("数据库连接成功!4444444444444");//程序暂时只能运行到这里....
Flag = m_pCon->Open((_bstr_t)constring,"","",adModeUnknown); 
MessageBox("数据库连接成功!");
this->OnOK();
}
else
{
MessageBox("数据库连接失败!");
this->OnOK();
}
}
catch(_com_error err)
{
AfxMessageBox("连接数据库失败,用户名/密码错误或则没有打开服务器/连接网络!");
this->OnOK();
return;