| Mailing List | | Home | | MySQL General - General MySQL discussion | | MaxDB - Everything about MaxDB, formerly known as SAP DB | | MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP | | Java Help - Mostly related to the MySQL Connector/J driver | | ODBC - ODBC with the MySQL Connector/ODBC driver | | Perl - Perl support for MySQL with DBI and DBD::mysql | | MySQL++ - Programming with the C++ API to MySQL |
|
|
  | |  | hello , Can I ask you a question about "MFC + ODBC + MYSQL " | hello , Can I ask you a question about "MFC + ODBC + MYSQL " 2004-03-15 - By
Back hello , mysql . first,sorry for my poor english .
I 'm used CRecordSet to connected database of mysql(linux) . Read source data no error , but can 't write data , has a "memory allocation error " error in used CRecordSet::Update() . into debug , this error (
CATCH_ALL(e)
{
lResult = AfxGetThread()- >ProcessWndProcException(e, &pThreadState- >m_lastSentMsg);
TRACE1( "Warning: Uncaught exception in WindowProc (returning %ld).\n ",
lResult);
DELETE_EXCEPTION(e);
}
END_CATCH_ALL " )
appear in the fun of AfxCallWndProc in wincode.cpp .
my code
CDatabase m_LinuxDB;
CLinuxSet * m_pSet;
m_LinuxDB.OpenEx( _T( "DSN=LSource;UID=zhang;PWD= "), CDatabase::noOdbcDialog );
m_pSet = new CLinuxSet(&m_LinuxDB);
m_pSet- >Open(CRecordset::snapshot,s "select * from [Author] "); //mysql isn 't support CRecordset::dynaset and CRecordset::dynamic
m_pSet- >m_AName = "zhang "; //the length of m_AName is 256(char) in table (m_AName 对应的表中的字段为char的,长256)
m_pSet- >m_AInfo = "zhb "; //the type of m_AInfo is text in table (m_AInfo 对应的类型是text 的)
m_pSet- >Update(); // occur error -- >a messagebox "memory allocation error "
Can you tell me that 's why? how to solve .
我用MFC的CRecordSet类连接linux上的mysql数据库 ,连接正确,也可以读出里面的数据,但是就是不能更新里面的数据 。也就是说一用CRecordSet::Update()就出错,弹出一个MessageBox“memory allocation error” ,调试模式进入WINCODE.CPP的AfxCallWndProc函数里面。出现这错误是什么原因呢?
我的ODBC是MyODBC-3.51 ,你能帮我说说出错的原因么?怎么处理才能使之正确?
Thanks!
致
礼!
张红兵
zh_aoi_ng@(protected)
-- ---- ---- ---- ---- ---- -----
Do You Yahoo!?
完全免费的雅虎电邮,马上注册获赠额外60兆网络存储空间
|
|
 |