ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update a record in the recordset (https://www.excelbanter.com/excel-programming/357957-update-record-recordset.html)

OverAC[_17_]

Update a record in the recordset
 

Dears,
I was so confused when reading documents about updating record in th
recordset using ADO. So please help me.
How can I change a record in the recordset and update it to the sourc
data.
Thanks so much for your help.
OverA

--
OverA
-----------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...fo&userid=3239
View this thread: http://www.excelforum.com/showthread.php?threadid=52952


AA2e72E

Update a record in the recordset
 
If your recordset object is RS:
To update/change a value in the recordset:

RS.Fields("MYFIELD").VALUE = your Value ' ensure value is the same as the
underlying type

To update the source:

RS.Update

For this to work, 1. you need to have opened the recordset with the
'correct' cursor 2. the data source must support Update (or UpdataBatch);
some data sources (like Excel) do not support this functionality.

"OverAC" wrote:


Dears,
I was so confused when reading documents about updating record in the
recordset using ADO. So please help me.
How can I change a record in the recordset and update it to the source
data.
Thanks so much for your help.
OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=529527



OverAC[_18_]

Update a record in the recordset
 

AA2e72E Wrote:
2. the data source must support Update (or UpdataBatch);
some data sources (like Excel) do not support this functionality

Ôi.
My data source is an another Excel file, please help...... :confused:

OverAC


--
OverAC
------------------------------------------------------------------------
OverAC's Profile: http://www.excelforum.com/member.php...o&userid=32396
View this thread: http://www.excelforum.com/showthread...hreadid=529527



All times are GMT +1. The time now is 07:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com