XP Pro SP3
QT 4.5.1
MySQL 5.1.31
Using MinGW (NOT MS Visual Studio)
compiled MySQL plugin as described in
http://www.jiggerjuice.net/software/qt-sql-drivers.html
Everything works fine EXCEPT cannot get any query results. Always get...
Using unsupported buffer type: 3 (parameter: 3) QMYSQL3: Unable to bind outvalues
When I run the QT sqlbrowser demo it reports exactly the same problem. It does show the list of tables but any access to them, either by double-clicking on a table name or executing a query in the query window produces the above error.
This has been tried on TWO different machines, both of which are CLEAN (e.g. install and patch XP, install Apache 2.2.11, MySQL 5.1.31, PHP 5.2.8, QT 4.5.1, make plugins as per page above and copy qsqlmysqld4.dll, libqsqlmysqld4.a to c:\qt\plugins\sqldrivers)
I have searched and searched and have pretty much drawn a blank. Similar problems seem to have been fixed by changing mysql dll
e.g.
unsupported buffer type
mysql library problem
MySQL Strange behaviour
I have PCTools firewall installed. I have disabled this. No difference.
I have tried localhost and 127.0.0.1. No difference.
Using mysql command line client works perfectly.
Accessing database using PHP works perfectly
db.setHostName("localhost");
db.setDatabaseName(<valid database>);
db.setUserName(<valid username>);
db.setPassword(<valid password>);
bool ok = db.open();
if (ok)
{
// QSqlQuery query("select Event_Title from events where Event_ID=79");
QSqlQuery query
("select event_title,s.series_id,series_title from events,series s where event_id=79 and events.series_id=s.series_id");
if (!query.isValid())
{
QMessageBox::information(this,
"Last Error",query.
lastError().
text());
// The more simple query gives no error but also produces no results
// however QSqlError.errorNumber = -1
}
while( query.next() )
{
// NEVER EVER get here!!!!
// That is the problem in a nutshell!!!
QString event_title
= query.
value(0).
toString();
QMessageBox::information(this,
"event_title",event_title
);
}
db.close();
}
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
db.setDatabaseName(<valid database>);
db.setUserName(<valid username>);
db.setPassword(<valid password>);
bool ok = db.open();
if (ok)
{
// QSqlQuery query("select Event_Title from events where Event_ID=79");
QSqlQuery query("select event_title,s.series_id,series_title from events,series s where event_id=79 and events.series_id=s.series_id");
if (!query.isValid())
{
QMessageBox::information(this,"Last Error",query.lastError().text());
// The more simple query gives no error but also produces no results
// however QSqlError.errorNumber = -1
}
while( query.next() )
{
// NEVER EVER get here!!!!
// That is the problem in a nutshell!!!
QString event_title = query.value(0).toString();
QMessageBox::information(this,"event_title",event_title);
}
db.close();
}
To copy to clipboard, switch view to plain text mode
I have tried just about every combination, property, and method of QSqlDatabase, QSqlQuery, QSqlQueryModel, QSqlRecord, QSqlError, etc... all to no avail.
The instance of the QSqlDatabase object seems to be connected ok. I can get a list of tables, etc. But that is all. And exactly the observed behaviour of the sqlbrowser demo as well.
I have tried a large number of SQL queries, and checked each query in phpMyAdmin (OK) and in the cmd line mysql client (OK).
I am a newbie to QT and think QT is awesome. But this is causing me some serious headache and heartache. Any suggestions or help gratefully received.
Thanks
Bookmarks