How to update calculated fields in SQL query? 
Author Message
 How to update calculated fields in SQL query?

I have SQL query like
/ select a, b, a/b as calc from table /
After updating a or b, calc remains the same.
Moving across and updating the recordset doesn't help.
Even Resync method has no result.

That happens with both client and server-side cursor against MSSQL Server
and client-side cursor against MS Jet db.

(I know DAO where calc is updated immediately, so ADO confuse me in that
case)

PLEASE help.

--
With best regards, Alexander Nenashev
www: http://www.*-*-*.com/

icq: 137 555 201



Mon, 26 Apr 2004 03:51:38 GMT  
 How to update calculated fields in SQL query?
Hi Alexander,

ADO will not update calculated fields. You need to update
them from your code. Try Requery method of recoredset. It
should reexecute your SELECT statement, so you will get
new calculated values.

Val

Quote:
>-----Original Message-----
>I have SQL query like
>/ select a, b, a/b as calc from table /
>After updating a or b, calc remains the same.
>Moving across and updating the recordset doesn't help.
>Even Resync method has no result.

>That happens with both client and server-side cursor

against MSSQL Server
Quote:
>and client-side cursor against MS Jet db.

>(I know DAO where calc is updated immediately, so ADO
confuse me in that
>case)

>PLEASE help.

>--
>With best regards, Alexander Nenashev
>www: http://www.iews-tfcp.ru/webmaster

>icq: 137 555 201

>.



Mon, 26 Apr 2004 04:15:57 GMT  
 How to update calculated fields in SQL query?
Hi Val, thank you for reply.

Unfortunately, Requery reopens the recordset, so the last loses some
valuable information such a current record position and the like. Moreover
if you have TCP/IP connection 28800 bit/s with a SQL server such Requeries
may be a headache for an user.

Where can I read exactly that ADO doesn't update calculated fields (MSDN
Library, web sites)?
Do you know about some reference?
--
With best regards, Alexander Nenashev
www: http://www.iews-tfcp.ru/webmaster

icq: 137 555 201


Quote:
> Hi Alexander,

> ADO will not update calculated fields. You need to update
> them from your code. Try Requery method of recoredset. It
> should reexecute your SELECT statement, so you will get
> new calculated values.

> Val



Mon, 26 Apr 2004 04:51:56 GMT  
 How to update calculated fields in SQL query?
Hi,

Why do not you want to update your calculated field  from
code? First update FiledA, next FieldB and after this
update FieldC (which is calculated) assigning new
calculated value to it. In that case you do not need to go
to server again. But you will have some limitations. But
as I know you will be able to update calculated field only
on disconnected recordset.

Val

Quote:
>-----Original Message-----
>Hi Val, thank you for reply.

>Unfortunately, Requery reopens the recordset, so the last
loses some
>valuable information such a current record position and
the like. Moreover
>if you have TCP/IP connection 28800 bit/s with a SQL

server such Requeries
Quote:
>may be a headache for an user.

>Where can I read exactly that ADO doesn't update

calculated fields (MSDN
Quote:
>Library, web sites)?
>Do you know about some reference?
>--
>With best regards, Alexander Nenashev
>www: http://www.iews-tfcp.ru/webmaster

>icq: 137 555 201



>> Hi Alexander,

>> ADO will not update calculated fields. You need to
update
>> them from your code. Try Requery method of recoredset.
It
>> should reexecute your SELECT statement, so you will get
>> new calculated values.

>> Val

>.



Mon, 26 Apr 2004 06:11:46 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Updating fields after SQL query

2. table.field value calculated based on query

3. Updating Calculated field depending on Current Date

4. calculating a field in a query...

5. ADO Update of calculated field

6. calculated field and update

7. 2nd SQL Server update after update text field corrupts row - using RDO

8. Updating data to a memo field using SQL UPDATE

9. referance to a Calculate field in SQL Server

10. SQL and calculated fields (MyFunction...) (Engineering)

11. Calculated Field in SQL?

12. referance to a Calculate field in SQL Server

 

 
Powered by phpBB® Forum Software