troubleshooting Question

Borland Builder C++ 6.0 : Command Out of Sync Issue

Avatar of checkin
checkin asked on
C++
4 Comments1 Solution489 ViewsLast Modified:
Hello

I have a DB issue that I cannot find an explanation or a clue to in the help files and thought you might be able to help us.

We are developing a DB project in BorlandC++6.0. We are connecting to MySQL via a DLL and using the TSQLDataSet, TDataSetProvider, TClientDataSet and the TDataSource all connected thru a TSQLConnection component.

While Querying, Appending, Deleting thru this components are not a problem. The only funny situations arise when using a DBGrid and directly try to run first Post() and then ApplyUpdates(-1) on any changes to the DBGrid
associated with a DataSource. When we first wrote the event for the SAVE button (see below) it used to work fine for a while, then for some reason, every time that the program tries to run that method it keeps raising an
exception with the message "Command Out of sync, you cannot run this command now", even more bizarre, it started to work again and now is back giving the same error, all without a line of code within the event being changed!!!

void __fastcall TAirline::BitBtn2Click(TObject *Sender)
{
 if(ClientDataSet->State==dsEdit || ClientDataSet->State==dsInsert)
  ClientDataSet->Post();

 ClientDataSet->ApplyUpdates(-1);
}

So, have you encountered this kind of behaviour/error before and the possible causes to it? might it be a DB configuration issue?!? The application runs on Windows 98 but connects remotely to a Unix server with the MySQL database.

can you help?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros