Page 1 of 1

Problem with insert, autorefresh

Posted: Mon 16 Nov 2009 08:14
by igor
Hello.
I use delphi 7, MS SQL server 2005 and try to use other version of sdac.

When set compatibility level 80 on database all good. When I insert record into view, I see id of new record and i can to update or delete this record.

When set compatibility level 90 I have a problem. When I insert record into view, I don't see id of new record on old version of sdac (3.80) and on new version i have error (refresh faild. Found 0 records)

I can't use manual insert and refresh because i have big project with use sdac 3.80.

Anyone have ideas how i can use compatibility level 90 and sdac

Posted: Tue 17 Nov 2009 09:42
by Dimon
I can not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create and fill a table.

Posted: Tue 17 Nov 2009 12:29
by igor
I send email with small example to dmitryg*devart*com.

Posted: Wed 18 Nov 2009 13:22
by Dimon
Thank you for information.

The problem is that when you insert record in view, then a new value of autoincrement field is not returned, and in refresh query the NULL value is included.
To solve the problem you should set the SQLRefresh property, like this:

Code: Select all

SELECT Id, name, productCatId
FROM products
WHERE name = :name and productCatId = :productCatId

Posted: Mon 23 Nov 2009 12:08
by igor
Thank you for answer.

But it is not a good solution for my problem. Because I don't want to rewrite all msqueries in my project.

Maybe you know why all work when i set compatibility level 80. Maybe possible modify source of SDAC to solve the problem?

Posted: Tue 24 Nov 2009 09:05
by Dimon
Different behaviour of SDAC is connected with different behaviour of SQL Server. The point is that SQL Server with compatibility level 80 returns information about autoincrement fields, and with compatibility level 90 does not return this information.