Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

about VC+MySQL problem:)

about VC+MySQL problem:)

i install mysql odbc V5.0 driver
i need to ADO Connect MYSQL DB;

code:
_ConnectionPtr m_CMConnect;
::CoInitialize(NULL);
m_CMConnect.CreateInstance(__uuidof(Connection));
m_CMConnect->Open("Provider=MySQL;server=localhost;DataBase=test;port=3306;uid=root;pwd=","","",-1);

but Program run error....

how to Ado Connect MYSQL DB;

thank:)
[427 byte] By [rxgmoral] at [2007-11-11 9:52:50]
# 1 Re: about VC+MySQL problem:)
Hi,
have a look on http://www.connectionstrings.com/
Might give you a hint...
But what exactly is your error?
Wrap your code in a try{/*your code*/}catch(_com_error e) {/* handle here */}
to examine what exactly went wrong.

Cheers
D
drkybelk at 2007-11-11 20:59:52 >
# 2 Re: about VC+MySQL problem:)
thank you ,drkybelk :)
rxgmoral at 2007-11-11 21:00:47 >