Page 1 of 1

Identity field and autorefresh on insert

Posted: Fri 23 Jul 2010 23:10
by davort
Hello!

After upgrading from 4.80.0.58 to 4.80.0.59, a strange behaviour occured - after inserting a second record into a TMSQuery, which has a scope_identity() function to get an autoincrement key field value, the refresh fails with a message that there weren't enough parameters passed into the query.

I had to go back to 4.80.0.58, because I couldn't find a workaround ... :)

My TMSQuery has refresh on insert and on update. All SQL statements are filled. The key field is an autoincrement field, for which a set is defined by using scope_identity() function (SET ID_field = :Scope_identity()).

I do the first insert, and I get ID_field value correctly, also refresh is ok, because the value of added ID_field is passed to refresh SQL statement.

Then I do the second insert, ID_field is assigned ok, record is added to the database table, but when the component tries to do the refresh, NO PARAMETER is passed to the refresh SQL.

I've been monitoring the thing with DBMON, so that I could see what was going on...

Then I uninstalled the latest version and went back to .58. Recompiled the app, and tried again - this time everything went perfect.

Therefore I assume, that in the .59 version, something has been "improved" in a way that my program no longer works ... :)


I hope this is just a minor matter, that would be fixed soon.


Otherwise, I love using your VCL components, because they are extremely simple to use, and on the other hand extremely effective!

Keep up the good work!!!


Thanks again and best regards from Slovenia,

Davor

8)

Posted: Mon 26 Jul 2010 09:05
by Dimon
Thank you for the information. We have fixed this problem. This fix will be included in the next SDAC build.

Posted: Tue 27 Jul 2010 18:55
by davort
Perfect!

Thank You!

8)