Page 1 of 1

commands out of sync

Posted: Fri 21 Jan 2005 15:15
by enzo arlati
The code belowe after it is called 3-4 times give me the error "commands out of sync".
EAssertionFailed with message 'Unknown MySQL datatype (116 ) d:\Projects\Delphi\MyDac\Source\MyClasses.pas line 879 "

I'm using c++builder 6 with your dbexpress driver and mysql 4.1.7
I have nothing on my disk D ( is my cdrom driver )

What can I do ?

Regards E. arlati


TSQLDataSet * dsTmp;
strSql = "select t.* from tipi_pmv t where t.codice = ";
strSql += "( select l.tipopmv from lista_pmv l ";
strSql += Format( "where l.nomenodo = '%s' )", ARRAYOFCONST(( fNomeNodo )));



dsTmp = new TSQLDataSet( NULL );
dsTmp->SQLConnection = DataModule_PMV->SQLConnectionSIV;
dsTmp->CommandType = ctQuery;
dsTmp->CommandText = strSql;
dsTmp->Open();


if( dsTmp )
{
fNumCharAlfa = dsTmp->FieldByName( "NumCharAlfa" )->AsInteger;
fNumRigheAlfa = dsTmp->FieldByName( "NumRigheAlfa" )->AsInteger;
dsTmp->Close();
delete dsTmp;
dsTmp = 0;
}

.............Commands out of sync

Posted: Fri 21 Jan 2005 15:40
by e. arlati
1- strSql = "select * from tipi_pmv ";

2- strSql = "select t.* from tipi_pmv t ";

The 2 statement belowe seems equal but the first work while the second give the error described in the previous e-mail.
What is the difference ?

Posted: Fri 21 Jan 2005 15:51
by Guest
New consideration....
the statement working with dbexpress work bad with mysql, that is it doesn't return a good header, like show in the example belowe.
I restart the mysql service and now the statement is correct with mysql, but now both the statement generate the error reported in the first message

mysql> select * from tipi_pmv;
+------+------+------+------+-------------------------------------------------+
|@ | | | | |
+------+------+------+------+-------------------------------------------------+
| 430 | 3 | 60 | 2 | Alfanumerico 3 righe da 202 pittogrammi 64x64x4 |
+------+------+------+------+-------------------------------------------------+
10 rows in set (0.00 sec)

mysql> select t.* from tipi_pmv t;
+--------+--------------+-------------+----------------+-------------------------------------------------+
| Codice | NumRigheAlfa | NumCharAlfa | NumPittogrammi | |
+--------+--------------+-------------+----------------+-------------------------------------------------+
| 430 | 3 | 60 | 2 | 20 caratteri (3 catene) + 2 pittogrammi 64x64x4 |
+--------+--------------+-------------+----------------+-------------------------------------------------+
10 rows in set (0.01 sec)

mysql>
mysql>
mysql> quit
Bye

C:\>net stop mysql
and
C:\>net start mysql

another suggestion

Posted: Fri 21 Jan 2005 15:58
by e. arlati
I replace the sql statement from the first to the second and all now works well, but still I'm wondering about the problem occur wirh the first statement.
Mybe should it be a bug ?

strSql = "select t.NumCharAlfa NumCharAlfa, t.NumRigheAlfa NumRigheAlfa ";
strSql += " from tipi_pmv t where t.codice = ";
strSql += "( select l.tipopmv from lista_pmv l ";
strSql += Format( "where l.nomenodo = '%s' )", ARRAYOFCONST(( fNomeNodo )));

strSql = "select t.NumCharAlfa NumCharAlfa, t.NumRigheAlfa NumRigheAlfa ";
strSql += " from tipi_pmv t where t.codice = ";
strSql += "( select l.tipopmv from lista_pmv l ";
strSql += Format( "where l.nomenodo = '%s' )", ARRAYOFCONST(( fNomeNodo )));

Re: .............Commands out of sync

Posted: Fri 21 Jan 2005 16:04
by Ikar
We couldn't reproduce the problem.
Please send us complete small sample (pas + exe) to demonstrate it and include script to create and fill tipi_pmv.

Also send us your configuration file of MySQL Server (my.ini).

Posted: Fri 21 Jan 2005 16:06
by e. arlati
The last message posted was incorrect, I repeat the corret one belowe
-------------------------------------------------------------------------------

I replace the sql statement from the first to the second and all now works well, but still I'm wondering about the problem occur wirh the first statement.
Mybe should it be a bug ?

strSql = "select t.* from tipi_pmv t where t.codice = ";
strSql += "( select l.tipopmv from lista_pmv l ";
strSql += Format( "where l.nomenodo = '%s' )", ARRAYOFCONST(( fNomeNodo )));


strSql = "select t.NumCharAlfa NumCharAlfa, t.NumRigheAlfa NumRigheAlfa ";
strSql += " from tipi_pmv t where t.codice = ";
strSql += "( select l.tipopmv from lista_pmv l ";
strSql += Format( "where l.nomenodo = '%s' )", ARRAYOFCONST(( fNomeNodo )));

Posted: Mon 24 Jan 2005 10:53
by Ikar
The error you described can be reproduced too hard. Unlikely we could help without complete sample.