
December 2nd, 2003, 04:23 PM
|
|
Contributing User
|
|
Join Date: Dec 2003
Location: The Netherlands
Posts: 39
Time spent in forums: 6 h 18 m 26 sec
Reputation Power: 5
|
|
|
CRecordset::Edit() throws an exception in Firebird
Hello,
I am writing a C++ application which uses the Firebird Database (v1.0.3).
I'm using the CRecordset class (MFC Library) to manipulate tables. No problem in adding rows, all works fine, but whenever I try to update an existing field, the recordset throws an exception. Here is a small code snippet:
Code:
CRecordset rst;
rst.m_strFilter = "SomeField = value"; // SomeField is PK or unique
rst.Open();
if (!rst.IsEOF())
{
try
{
rst.Edit();
rst.m_FIELDNAME1 = value;
rst.m_FIELDNAME2 = value;
rst.Update();
}
catch (CDBException *xcp)
{
MessageBox("Error:\n" + xcp->m_strError, "ERROR!");
xcp->Delete();
}
}
else
{
...
}
rst.Close();
Now when an update occurs, the application will throw error code -104, Unexpected end of command. Further, after the execution of this code, when I try to shut down the Guardian, it informs me there is an Overlapped I/O operation in progress (code 99).
I'm at a loss here, because the same code worked ok with Interbase 7.
Does anybody know the solution to this problem or see what I might be overlooking?
Thanks in Advance,
Sincerely,
Richard
ps: I realize this same post has been posted earlier in the C (++ #) forum, and apologize for the crosspost.
|