|
|
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
Есть код, создающий динамически dxMemData из колонок cxGrid Код: pascal 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Если выполнить данный код повторно возникает ошибка дублирования полей DataSet, подскажите почему ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 15:59:49 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
wsnet Код: pascal 1. 2. 3. 4. 5. 6. Добиваешь? wsnet Код: pascal 1. Это должно быть первой строкой. Ну и принято давать точный текст ошибки, а не свою трактовку. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 16:07:53 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
wsnet, Чистишь некорректно, значит. Нельзя вызвать Clear для Fields/FieldDefs? Или тупо пересодать батареи (с переподключением его контролирует, конечно). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 16:09:23 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
чччДИли тупо пересодать батареи датасет (с переподключением его контролирует, конечно). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 16:10:48 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
чччДчччДИли тупо пересодать батареи датасет (с переподключением его контролирует контролов, конечно). :( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 16:12:35 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
wsnet, AMemData.ClearFields - проще и понятнее. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 16:14:54 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
schiwsnet, AMemData.ClearFields - проще и понятнее. Учитывая, что пациент уже наваял, пусть лучше "с перебором" разберётся. О ведь такой же код где-то ещё применит. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 16:21:12 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
wadmanwsnet Код: pascal 1. 2. 3. 4. 5. 6. Добиваешь? wsnet Код: pascal 1. Это должно быть первой строкой. Ну и принято давать точный текст ошибки, а не свою трактовку. Добиваю ) разные варианты пробовал просто, в чем проблема не пойму ( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 19:42:59 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
чччДschiwsnet, AMemData.ClearFields - проще и понятнее. Учитывая, что пациент уже наваял, пусть лучше "с перебором" разберётся. О ведь такой же код где-то ещё применит. Это я ошибся. Не тот метод. Надо AMemData.Fields.Clear ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 19:46:08 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
schiчччДпропущено... Учитывая, что пациент уже наваял, пусть лучше "с перебором" разберётся. О ведь такой же код где-то ещё применит. Это я ошибся. Не тот метод. Надо AMemData.Fields.Clear Делаю таким образом: Код: pascal 1. 2. 3. 4. 5. 6. 7. 8. 9. И все равно ошибка: Код: pascal 1. В чем проблема не понимаю. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 20:42:23 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
wsnetИ все равно ошибка: Код: pascal 1. В чем проблема не понимаю. В том, что FieldDefs тоже надо очистить, видимо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 20:55:08 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
schi, А чем fielddefs отличается от field ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 21:18:03 |
|
||
|
Дублирование полей DataSet при повторном выполнении
|
|||
|---|---|---|---|
|
#18+
wsnetschi, А чем fielddefs отличается от field ? "Datasets use TFieldDefs to manage the field definitions they use to create field objects that correspond to fields in a database table. Every field definition listed by TFieldDefs has a corresponding TField object, but not all TField objects have a corresponding field definition. For example, calculated fields do not have field definitions. TTable and TClientDataSet objects also use TFieldDefs when creating a new table. With object field types, such as TADTField and TArrayField , there are two ways to represent the field definitions: hierarchically or flattened. When represented hierarchically, object field definitions contain a set of child definitions for the constituent subfields. When represented as a flattened set, child field definitions appear as siblings sequentially after the parent field definition. TFieldDefs stores field definitions hierarchically. This is in contrast to TFieldDefList , which lists the child TFieldDef objects of object fields sequentially after the parent TFieldDef . Use the properties and methods of TFieldDefs to: Access a specific field definition. Add or delete field definitions from the list (when creating new tables). Find out how many fields are defined. Copy a set of field definitions to another dataset. " vs "TField encapsulates the fundamental behavior common to all field components. It introduces the properties, events, and methods that are used to: Change the value of a field in a dataset. Convert the value of a field from one data type to another. Validate data that the user enters for a field. Define how the data in the field appears as it is displayed or edited. Calculate the value of a field from code written in the OnCalcFields event of the dataset. Look up the field's value from another dataset. Do not create instances of TField. TField descendants are created automatically each time a dataset is activated. These descendants can be dynamic (the default) or persistent. Dynamic field components reflect the columns in the underlying metadata at the time a dataset is opened. Persistent field components are created at design time using the Fields editor, which specifies the fields in the dataset, their properties, and their ordering. Creating persistent field components guarantees that each time an application runs, it uses and displays the same columns, in the same order, even if the physical structure of the underlying database changes. If a column on which a persistent field component is based is deleted or changed, the IDE generates an exception rather than opening the dataset against a nonexistent column or mismatched data. If this happens, remove the field component for the nonexistent field using the Fields editor. " ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.09.2017, 22:40:58 |
|
||
|
|

start [/forum/topic.php?fid=58&fpage=132&tid=2041849]: |
0ms |
get settings: |
7ms |
get forum list: |
18ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
60ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
64ms |
get tp. blocked users: |
2ms |
| others: | 225ms |
| total: | 397ms |

| 0 / 0 |
