Connecting MySQL through ADO with MyOLEDB provider
Recently I have tried to develope a software using VC++ MFC and MySQL Data Server. After I searched the web I found out that there's an ADO provider for MySQL named MyOLEDB. So I started working with it.
Everything was fine, I tried most of the queries such as select, updata, delete and insert into and it was all fine. Till recently I added a where cluase to my select query, by this act I got an unhandled exception on run-time which says there's a user breakpoint!! It gives out this exception in the line of opening my recordset:
try {
command->CommandText = query.data();
recordset->Open ( (IDispatch *) command, vtMissing, adOpenStatic,
adLockBatchOptimistic, adCmdUnknown);
}
Something funny is that even I placed the code in try block and have a catch(...) but I can't catch the exception!! Well if it's really a breakpoint then it makes sense but I didn't put a breakpoint there.
If I give it the query: "SELECT fldName FROM tblProjects;", it works fine but with query: "SELECT fldName FROM tblProjects WHERE fldID = 9;" I'll get the exception. Well I don't know if there's a problem with my code or MyOLEDB?!
I hope someone can help me cause I don't know what to do and I really need this.
Thanks,
Mehran Ziadloo

