I have a query that returns 1000 rows in about 5 secs on a local network.
Exactly the same query takes about 5 mins to complete across the internet(fast one).
I am using odbc driver against MSSQL database.
I suspect that the code I wrote to retrieve records might be the problem.
{
// db is an instance of QSqlDatabase, correctly initialized.
try
{
retval->setQuery(sql, db);
while (retval->canFetchMore())
retval->fetchMore();
return retval;
}
catch (...)
{
return NULL;
}
}
QAbstractTableModel* DBOperations::executeSelectWithParam (const char* sql, QVariant param)
{
// db is an instance of QSqlDatabase, correctly initialized.
try
{
QSqlQueryModel* retval = new QSqlQueryModel();
retval->setQuery(sql, db);
while (retval->canFetchMore())
retval->fetchMore();
return retval;
}
catch (...)
{
return NULL;
}
}
To copy to clipboard, switch view to plain text mode
Any advice/comment will be appreciated.
Bookmarks