Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Базы";
Текущий архив: 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
1-80992
shane54
2002-04-12 16:43
2002.04.25
Вроде элементарно.... но как? :)


1-80876
Minster
2002-04-12 22:57
2002.04.25
Что означает свойство Tag во всех компонентах?


6-81026
Ghost.
2002-02-12 13:12
2002.04.25
Вопрос по DNS


1-80892
OldGirstaris
2002-04-14 14:13
2002.04.25
Будут ли работать в Win2000 и в WinXP такие функции...


1-80856
besen-ok
2002-04-11 10:48
2002.04.25
Компенетра на Delphi (DLL) для 1С





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский