Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

ADO и обновление одной записи [D7, MSSQL]


Страницы:   1 2

Max Zyuzin ©   (2005-05-31 09:38:00) 

Приветствую всех, вот возникла необходимость делать обновление DataSet, а переоткрывать его не хочется, ибо большой запрос выбирает из большой таблицы. Хочется спросить, как правильно делать обновление для одной единственной записи в DataSet-е
Почитав help про методы Refresh Переоткрывает все целиком. Посмотрел метод Reync но в хелпе же указывается что в приложении должен использоваться Refresh вместо Resync... Ткните пожалуйста пальцем в какую сторону копать, и где можно почитать (вчера полистал перед сном пару книжек ничего не обнаружил обнадеживающего).


Anatoly Podgoretsky   (2005-05-31 10:26:00) [21]

Max Zyuzin ©   (31.05.05 10:08) [4]
Точно есть, в таком случае читай выделеное

Resync is used internallyby other dataset methods to resynchronize the dataset with underlying physical data when making calls that may change the internal cursor position. Applications should use the Refresh method instead of calling Resync.

После изменений данных, курсор уже на актуален, поэтому приложение должно использовать или Refresh или ReQuery (более предпочтително), а Refresh должен заменяться на Close/Open


Bronco   (2005-05-31 10:25:00) [22]


> Max Zyuzin ©   (31.05.05 10:08) [4]


> но как их обновить не ясно.

Читай статью приведенную в [3]

ADODataSet1.Properties['Update Resync'].Value := adResyncAll;


msguns   (2005-05-31 10:18:00) [23]

Видимо, имеется в виду вот это :

Refetches the active record and the records that precede and follow it.

type TResyncMode = set of (rmExact, rmCenter);
procedure Resync(Mode: TResyncMode); virtual;

Description

Resync is used internally by other dataset methods to resynchronize the dataset with underlying physical data when making calls that may change the internal cursor position. Applications should use the Refresh method instead of calling Resync.
Mode indicates optional processing that Resync should handle. If Mode contains rmExact, Resync raises an exception if Resync is called when the cursor is not positioned on a valid record. If Mode contains rmCenter, Resync positions the active record in the center of all buffered records.

Regardless of Mode, Resync also activates the buffers for the active record, retrieves prior and subsequent records for display purposes, and triggers a dataset change event.


Max Zyuzin   (2005-05-31 10:08:00) [24]

>Anatoly Podgoretsky ©   (31.05.05 10:01) [2]
TDataSet.Resync
Applications should use the Refresh method instead of calling Resync

>msguns ©   (31.05.05 09:55) [1]
Читал, читаю еще раз... пока не понимаю пока не вижу каким боком это относится непосредственно к обновлению данных. То есть ясно, что в курсор с блокировками опеределяют видимость изменений, но как их обновить не ясно.


Nikolay M.   (2005-05-31 10:05:00) [25]

http://www.delphikingdom.ru/asp/viewitem.asp?catalogid=413
?


Anatoly Podgoretsky   (2005-05-31 10:01:00) [26]

но в хелпе же указывается что в приложении должен использоваться Refresh вместо Resync
Это где ты такое прочитал?


msguns   (2005-05-31 09:55:00) [27]

Читай про курсоры и блокировки (CursorType+LockType)


Страницы:   1 2

Наверх

Титульная страница Поиск, карта сайта Написать письмо