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
.............Commands out of sync
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 ?
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 ?
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
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
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 )));
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
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).
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).
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 )));
-------------------------------------------------------------------------------
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 )));