测试代码很简单:
CDatabase mydatabase;
mydatabase.Open(_T("mysqlodbc-test"), FALSE, FALSE, "ODBC;UID=ROOT");CRecordset myrecordset(&mydatabase);
myrecordset.Open(AFX_DB_USE_DEFAULT_TYPE,"select * from mytable");
//执行到这里就出错。
/*****
debug call stack如下:
KERNEL32! 77e8b2f0()
TESTODBC! _CxxThrowException@8 + 57 bytes
AfxThrowDBException(short -1, CDatabase * 0x0012ff10 {CDatabase}, void * 0x00e215b8) line 70
CRecordset::ThrowDBException(short -1, void * 0x00000000) line 80 + 44 bytes
CRecordset::PrepareAndExecute() line 2485
CRecordset::Open(unsigned int 4294967295, const char * 0x00553030 `string', unsigned long 0) line 1104
****/
.....数据库使用mysql。安装了mysql的odbc driver 3.51请教问题出在哪里?