commands out of sync

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
enzo arlati

commands out of sync

Post by enzo arlati » Fri 21 Jan 2005 15:15

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;
}

e. arlati

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

Post by e. arlati » Fri 21 Jan 2005 15:40

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 ?

Guest

Post by Guest » Fri 21 Jan 2005 15:51

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

e. arlati

another suggestion

Post by e. arlati » Fri 21 Jan 2005 15:58

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 )));

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

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

Post by Ikar » Fri 21 Jan 2005 16:04

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).

e. arlati

Post by e. arlati » Fri 21 Jan 2005 16:06

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 )));

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 24 Jan 2005 10:53

The error you described can be reproduced too hard. Unlikely we could help without complete sample.

Post Reply