Page 1 of 1

Exception when using TMyStoredProc sequentially

Posted: Thu 06 Jul 2006 07:40
by redlake2
I get an error when running two MyStoredProc procedures one after the other. I am trying to identify whether the error is from MySql, Borland c++ 2006, or the CoreLab MySql component.

Exception class EMySqlException with message 'RecieveHeader: Net packets out of order: received[13], expected[1]'

I have one MyStoredProc, I change the parameter for the stored procedure by clicking on a button, then close the procedure if it is active in order to run it again. Perhaps I am supposed to reset it another way?

One button shows all cats, the other all dogs, using the same store procedure. It works for cats and then falls over when I click on the dog button, and the opposite if I click on the dog button first.

void __fastcall TForm1::btnCatsClick(TObject *Sender)
{
if (MyStoredProc->Active) {
MyStoredProc->Close();
}

// Filter to show only cats
MyStoredProc->ParamByName("Value")->AsString = "cat";
MyStoredProc->Execute();

}
//---------------------------------------------------------------------------
void __fastcall TForm1::btnDogClick(TObject *Sender)
{
if (MyStoredProc->Active) {
MyStoredProc->Close();
}

// Filter to show only dogs
MyStoredProc->ParamByName("Value")->AsString = "dog";
MyStoredProc->Execute();
}

Any suggestions?

Posted: Thu 06 Jul 2006 07:50
by Antaeus
Please send us (EvgeniyD*crlab*com) a complete small sample to demonstrate this problem, including script to create server objects.

Also supply us following information
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection Editor

Posted: Fri 07 Jul 2006 02:00
by redlake2
As requested I have emailed the database script, and borland project file. It is a very simple one form 3 buttons project and the database has only one table.

Using WindowsXP
MyDac 4.30.1.15
MySQL Server 5.0.22 - running on local machine.

Any help would be very much appreciated.

Posted: Fri 07 Jul 2006 09:36
by Antaeus
You set option AutoPrepare to True for StoredProc component. This bug of MySQL Server protocol with prepared stored procedures that return result set was discussed in this topic. To avoid this bug you should give up using preparing in this situation.