--- Alain Bertrand <[EMAIL PROTECTED]> wrote: > In a Qt4 application, I have the following bit of code : > > QString s; > bool b; > QSqlQuery q; > QSqlError err; > s= "CREATE TABLE ttd_bdata (sheetId integer primary key,"; > s+="creation_date date, modif_date date,"; > s+="speciesId integer,USDA_zone integer,"; > s+="generalities text,propagation text,care text,"; > s+="esthetics text, phyto text,miscellaneous text)"; > //s="SELECT * FROM ttd_species WHERE speciesId=4"; > qWarning( s.toAscii() ); > b=q.exec( s ); > > Executing the query fails with the following information > > SQL logic error or missing database > Unable to fetch row > Err number 1. > > If the query is remplaced by the commented one, I got no error. If I open my > database file with sqliteman, the query is executed without any problem. > Some ideas ?
I don't understand your description, but here are some random thoughts that might help you: CREATE statements do not return any rows. Your select table did not match the create statement table. Instead: Use "SELECT * FROM ttd_bdata WHERE speciesId=4" Don't use += in this case, as the following is more efficient: s = "CREATE TABLE ttd_bdata (sheetId integer primary key," "creation_date date, modif_date date," "speciesId integer,USDA_zone integer," "generalities text,propagation text,care text," "esthetics text, phyto text,miscellaneous text)"; ____________________________________________________________________________________ Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------