fnmblot
7th September 2006, 18:49
In my continuing quest for trying to build a database that tracks the music I have written, I have come to another wall. I am trying to insert 4 buttons in a form, First Next Prev and Last. Do you guys have any suggestions? I have checked the demos and examples and the documentation, but I don't really understand it. So far I have :
void nnDBSPieceViewForm::firstPushButtonSlot()
{ QSqlQuery query("SELECT piece_name FROM main ORDER BY uid");
query.exec();
query.first();
ui.pieceNameLineEdit->setText(query.value(0).toString());
qDebug("firstPushButton Pressed");
} // End firstPushButtonSlot
It compiles fine, but when I click the First button, in the console I receive:
QODBCResult::exec: Unable to execute statement:
[Microsoft][ODBC Driver Manager] Function sequence error
QSqlQuery::value: not positioned on a valid record
firstPushButton Pressed
Any suggestions?
Thanks in advance,
fnmblot
void nnDBSPieceViewForm::firstPushButtonSlot()
{ QSqlQuery query("SELECT piece_name FROM main ORDER BY uid");
query.exec();
query.first();
ui.pieceNameLineEdit->setText(query.value(0).toString());
qDebug("firstPushButton Pressed");
} // End firstPushButtonSlot
It compiles fine, but when I click the First button, in the console I receive:
QODBCResult::exec: Unable to execute statement:
[Microsoft][ODBC Driver Manager] Function sequence error
QSqlQuery::value: not positioned on a valid record
firstPushButton Pressed
Any suggestions?
Thanks in advance,
fnmblot