Identity field and autorefresh on insert

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
davort
Posts: 24
Joined: Sat 20 Jan 2007 14:37

Identity field and autorefresh on insert

Post by davort » Fri 23 Jul 2010 23:10

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)

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 26 Jul 2010 09:05

Thank you for the information. We have fixed this problem. This fix will be included in the next SDAC build.

davort
Posts: 24
Joined: Sat 20 Jan 2007 14:37

Post by davort » Tue 27 Jul 2010 18:55

Perfect!

Thank You!

8)

Post Reply