PDA

View Full Version : QDataMapper not saving data on mapper submit



rdjenner
12th August 2010, 23:28
I am very new, so forgive my ignorance. I have been trying for hours to get the mapper->submit to work and am failing miserabley. I can see the data on my form ok, but if I make changes and press my save button which only does mapper->submit I get QSqlquery errors about not positioned on a valid record. I can display message that tell me I have a valid record, so I am not sure what is going on. I am using a mysql db and the qodbc. Does that make a difference? What am I doing wrong?

ChrisW67
13th August 2010, 00:20
Does your table have a defined primary key?

rdjenner
13th August 2010, 00:25
Yes it does, although the key has multiple parts. Do I need a primary index with just one field?

ChrisW67
13th August 2010, 07:51
I think the ODBC driver might but I cannot test that at the moment. Are you able to test it or use the native MySql driver?

rdjenner
13th August 2010, 13:46
I will test today with a single field primary index. I am not able to get the qmysql odbc to work.

rdjenner
13th August 2010, 14:08
I tested the single field primary index and then the mapper.submit appeard to work but when I do the model.submitall I get an error invalid column '' in where clause and my data does save to the db.