Форум: "Базы";
Текущий архив: 2002.04.25;
Скачать: [xml.tar.bz2];
ВнизADO Problem Найти похожие ветки
← →
kig (2002-04-04 15:52) [16]2Sam © (03.04.02 21:32)
Фишка в том, что Refresh и Requery перечитывает записи с сервера и если CursorLocation=clUseClient, то пока ты не закроешь набор данных он не обновится на сервере (я пока еще не нашел как это сделать иным способом). При clUseServer обновление происходит сразу в двух наборах, ссылающихся на одну таблицу, но один из них надо отсортировать, что я ну никак не могу сделать...
Как Вам ранее заметил Delirium © (03.04.02 17:01) - сортировка адошного набора данных возможна только при при клинтском курсоре (как в прочем, и фильтрация) (MSDN):
Remarks
This property requires the CursorLocation property to be set to adUseClient. A temporary index will be created for each field specified in the Sort property if an index does not already exist.
Если Вы будете работать с серверным курсором, то Вы не сможете получить ту функциональность, которая Вам нужна, без переоткрытия соритируемого нд с необходимым условием Order By в select.
Если Вы будете работать с клиентским курсором, то в этом случае:
1. (Sam © (03.04.02 21:32) Фишка в том, что Refresh и Requery перечитывает записи с сервера и если CursorLocation=clUseClient, то пока ты не закроешь набор данных он не обновится на сервере (я пока еще не нашел как это сделать иным способом).) - у адошного рекодсета есть метод UpdateBatch - он отправляет изменения в провайдер OLE DB...
2. Посмотрите в MSDN метод Resync - возможно он поможет Вам с полями-счетчиками при клиентском рекодсете.
3. Если у Вас уже есть один клиентский адо-рекодсет, а Вы хотите получить такой-же, но с возможностью другой сортировки и/или фильтации - используйте клонирование (MSDN):
Clone Method
Creates a duplicate Recordset object from an existing Recordset object. Optionally, specifies that the clone be read-only.
Syntax
Set rstDuplicate = rstOriginal.Clone (LockType)
Return Value
Returns a Recordset object reference.
Parameters
rstDuplicate
An object variable that identifies the duplicate Recordset object to be created.
rstOriginal
An object variable that identifies the Recordset object to be duplicated.
LockType
Optional. A LockTypeEnum value that specifies either the lock type of the original Recordset, or a read-only Recordset. Valid values are adLockUnspecified or adLockReadOnly.
Remarks
Use the Clone method to create multiple, duplicate Recordset objects, particularly if you want to maintain more than one current record in a given set of records. Using the Clone method is more efficient than creating and opening a new Recordset object with the same definition as the original.
The Filter property of the original Recordset, if any, will not be applied to the clone. Set the Filter property of the new Recordset in order to filter the results. The simplest way to copy any existing Filter value is to assign it directly, like this: rsNew.Filter = rsOriginal.Filter
The current record of a newly created clone is set to the first record.
Changes you make to one Recordset object are visible in all of its clones regardless of cursor type. However, after you execute Requery on the original Recordset, the clones will no longer be synchronized to the original.
Closing the original Recordset does not close its copies, nor does closing a copy close the original or any of the other copies.
Советую Вам посмотреть в MSDN описание ADODB - будет проще понять, что там делает дельфийская обертка вокруг этих объектов.
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.04.25;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.008 c