I know the diference on qt3 and 4 with the pointer on the database connection
the problem on using qmysql on windows... well at this time I just think it's imposible... at least everything I've tryed didn't work I just give up on that.. if you search all my posts here I think you'll find out that 4/5 of them are about the qmysql pluginI even made a how-to about it and it worked for others but not here on 3 windows!!! Qt hates me 
I just hope ODBC works... if not.. well.. no more qt+mysql for me
by the way I think it isn't connecting:
bool creaConexion()
{
if (defaultDB!=0)
{
defaultDB->setHostName( DB_HOSTNAME );
qWarning("host seteado");
defaultDB->setDatabaseName( "Driver={MySQL};Server="+DB_HOSTNAME+";Database="+DB_NOM+";Uid="+DB_USR+";Pwd="+DB_PASS+";" );
defaultDB->setUserName( DB_USR );
defaultDB->setPassword( DB_PASS );
if ( ! defaultDB->open() )
{
QMessageBox::warning(0,
"Fallo de conexión",
"No se pudo conectar con la base de datos: " + DB_NOM
+ "tabla: " + DB_TABLA
+ "\n" + defaultDB
->lastError
().
driverText());
return FALSE;
}
QMessageBox::information(0,
"Conexión estabecida",
"Conectado a: " + DB_HOSTNAME
+ " " + "tabla: " + DB_TABLA
+ " "+ DB_NOM
);
qWarning("No pesko");
return TRUE;
}
}
QSqlDatabase *defaultDB;
bool creaConexion()
{
defaultDB = QSqlDatabase::addDatabase( DBDRIVER );
if (defaultDB!=0)
{
defaultDB->setHostName( DB_HOSTNAME );
qWarning("host seteado");
defaultDB->setDatabaseName( "Driver={MySQL};Server="+DB_HOSTNAME+";Database="+DB_NOM+";Uid="+DB_USR+";Pwd="+DB_PASS+";" );
defaultDB->setUserName( DB_USR );
defaultDB->setPassword( DB_PASS );
if ( ! defaultDB->open() )
{
QMessageBox::warning(0, "Fallo de conexión", "No se pudo conectar con la base de datos: " + DB_NOM + "tabla: " + DB_TABLA + "\n" + defaultDB->lastError().driverText());
return FALSE;
}
QMessageBox::information(0,"Conexión estabecida","Conectado a: " + DB_HOSTNAME + " " + "tabla: " + DB_TABLA + " "+ DB_NOM);
qWarning("No pesko");
return TRUE;
}
}
To copy to clipboard, switch view to plain text mode
the qWarning tells me:
QODBC3: Unable to connect
and on console:
QODBCDriver::disconnect: Unable to disconnect datasource Error: [unixODBC][Driver Manager]Connnection does not exist
Bookmarks