Página 1 de 1

DataSet:Close()

Publicado: Vie Jul 21, 2006 9:27 pm
por Aguiar Costa
Hello !!!
I have a DbfDataset that i use to open a table A or a table B as the user
shooses one or another...To do that i close the Dataset, change the table
name and open it again. It works. The problem is that although the name and
records of the table is changed the DbfDataset:aFields is never changed. To
solve this I had to destroy the Dataset object ( :End() ) and create it
again.
Attached is a sample that shows that Dataset:aFields is allways the same.
Is this the normal behavior ?
TIA.
Aguiar !!!


Attached files DataSet.zip (2.1 KB)Â

DataSet:Close()

Publicado: Lun Jul 24, 2006 9:47 am
por ignacio
Aguiar,
That is completely normal. Is the standard behaviour. The fact that the
DataSet is closed it does not mean is completely destroyed.
Regards,
"Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
> Hello !!!
>
> I have a DbfDataset that i use to open a table A or a table B as the user
> shooses one or another...To do that i close the Dataset, change the table
> name and open it again. It works. The problem is that although the name
> and records of the table is changed the DbfDataset:aFields is never
> changed. To solve this I had to destroy the Dataset object ( :End() ) and
> create it again.
> Attached is a sample that shows that Dataset:aFields is allways the same.
> Is this the normal behavior ?
> TIA.
> Aguiar !!!
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 9:47 am
por NoName
Aguiar,
That is completely normal. Is the standard behaviour. The fact that the
DataSet is closed it does not mean is completely destroyed.
Regards,
"Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
> Hello !!!
>
> I have a DbfDataset that i use to open a table A or a table B as the user
> shooses one or another...To do that i close the Dataset, change the table
> name and open it again. It works. The problem is that although the name
> and records of the table is changed the DbfDataset:aFields is never
> changed. To solve this I had to destroy the Dataset object ( :End() ) and
> create it again.
> Attached is a sample that shows that Dataset:aFields is allways the same.
> Is this the normal behavior ?
> TIA.
> Aguiar !!!
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 10:59 am
por Aguiar Costa
Ignacio,
But if the Dataset table is changed, shouldn't the fields related to it be
changed automatically ?
When the Dataset is set to open what's the logic of having :aFields with the
content of another table ??? ...maybe it should generate an error !!!
Regards.
Aguiar !!!
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
news:44c47b01$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Aguiar,
>
> That is completely normal. Is the standard behaviour. The fact that the
> DataSet is closed it does not mean is completely destroyed.
>
> Regards,
>
> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
> news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
>> Hello !!!
>>
>> I have a DbfDataset that i use to open a table A or a table B as the user
>> shooses one or another...To do that i close the Dataset, change the table
>> name and open it again. It works. The problem is that although the name
>> and records of the table is changed the DbfDataset:aFields is never
>> changed. To solve this I had to destroy the Dataset object ( :End() ) and
>> create it again.
>> Attached is a sample that shows that Dataset:aFields is allways the same.
>> Is this the normal behavior ?
>> TIA.
>> Aguiar !!!
>>
>>
>
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 10:59 am
por Aguiar Costa
Ignacio,
But if the Dataset table is changed, shouldn't the fields related to it be
changed automatically ?
When the Dataset is set to open what's the logic of having :aFields with the
content of another table ??? ...maybe it should generate an error !!!
Regards.
Aguiar !!!
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
news:44c47b01$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Aguiar,
>
> That is completely normal. Is the standard behaviour. The fact that the
> DataSet is closed it does not mean is completely destroyed.
>
> Regards,
>
> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
> news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
>> Hello !!!
>>
>> I have a DbfDataset that i use to open a table A or a table B as the user
>> shooses one or another...To do that i close the Dataset, change the table
>> name and open it again. It works. The problem is that although the name
>> and records of the table is changed the DbfDataset:aFields is never
>> changed. To solve this I had to destroy the Dataset object ( :End() ) and
>> create it again.
>> Attached is a sample that shows that Dataset:aFields is allways the same.
>> Is this the normal behavior ?
>> TIA.
>> Aguiar !!!
>>
>>
>
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 11:37 am
por ignacio
Aguiar,
If you change the dataset table name you should destroy de DataSet first
with the Destroy() method
I am not sure if we should completely reset the DataSet when its table name
is changed, since you will also lose any calculated field for example. I
prefer to leave it how it is. Suppose the new table has the same structure
that the old one (very usual I am afraid). In that case for sure you will
not want to lose that information, ans some other users will complain about
it.
Regards,
"Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
news:44c48b4c$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Ignacio,
>
> But if the Dataset table is changed, shouldn't the fields related to it be
> changed automatically ?
> When the Dataset is set to open what's the logic of having :aFields with
> the content of another table ??? ...maybe it should generate an error !!!
> Regards.
> Aguiar !!!
>
> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
> news:44c47b01$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>> Aguiar,
>>
>> That is completely normal. Is the standard behaviour. The fact that the
>> DataSet is closed it does not mean is completely destroyed.
>>
>> Regards,
>>
>> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
>> news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
>>> Hello !!!
>>>
>>> I have a DbfDataset that i use to open a table A or a table B as the
>>> user shooses one or another...To do that i close the Dataset, change the
>>> table name and open it again. It works. The problem is that although the
>>> name and records of the table is changed the DbfDataset:aFields is never
>>> changed. To solve this I had to destroy the Dataset object ( :End() )
>>> and create it again.
>>> Attached is a sample that shows that Dataset:aFields is allways the
>>> same.
>>> Is this the normal behavior ?
>>> TIA.
>>> Aguiar !!!
>>>
>>>
>>
>>
>>
>
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 11:37 am
por NoName
Aguiar,
If you change the dataset table name you should destroy de DataSet first
with the Destroy() method
I am not sure if we should completely reset the DataSet when its table name
is changed, since you will also lose any calculated field for example. I
prefer to leave it how it is. Suppose the new table has the same structure
that the old one (very usual I am afraid). In that case for sure you will
not want to lose that information, ans some other users will complain about
it.
Regards,
"Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
news:44c48b4c$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Ignacio,
>
> But if the Dataset table is changed, shouldn't the fields related to it be
> changed automatically ?
> When the Dataset is set to open what's the logic of having :aFields with
> the content of another table ??? ...maybe it should generate an error !!!
> Regards.
> Aguiar !!!
>
> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
> news:44c47b01$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>> Aguiar,
>>
>> That is completely normal. Is the standard behaviour. The fact that the
>> DataSet is closed it does not mean is completely destroyed.
>>
>> Regards,
>>
>> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
>> news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
>>> Hello !!!
>>>
>>> I have a DbfDataset that i use to open a table A or a table B as the
>>> user shooses one or another...To do that i close the Dataset, change the
>>> table name and open it again. It works. The problem is that although the
>>> name and records of the table is changed the DbfDataset:aFields is never
>>> changed. To solve this I had to destroy the Dataset object ( :End() )
>>> and create it again.
>>> Attached is a sample that shows that Dataset:aFields is allways the
>>> same.
>>> Is this the normal behavior ?
>>> TIA.
>>> Aguiar !!!
>>>
>>>
>>
>>
>>
>
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 11:49 am
por Aguiar Costa
Ignacio,
I understand that. It just took me a lot of time to see what was happening.
Maybe this should be stressed out in the help files.
Thanks.
Aguiar !!!
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
news:44c494ed$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Aguiar,
>
> If you change the dataset table name you should destroy de DataSet first
> with the Destroy() method
>
> I am not sure if we should completely reset the DataSet when its table
> name is changed, since you will also lose any calculated field for
> example. I prefer to leave it how it is. Suppose the new table has the
> same structure that the old one (very usual I am afraid). In that case for
> sure you will not want to lose that information, ans some other users will
> complain about it.
>
> Regards,
>
> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
> news:44c48b4c$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>> Ignacio,
>>
>> But if the Dataset table is changed, shouldn't the fields related to it
>> be changed automatically ?
>> When the Dataset is set to open what's the logic of having :aFields with
>> the content of another table ??? ...maybe it should generate an error !!!
>> Regards.
>> Aguiar !!!
>>
>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
>> news:44c47b01$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>>> Aguiar,
>>>
>>> That is completely normal. Is the standard behaviour. The fact that the
>>> DataSet is closed it does not mean is completely destroyed.
>>>
>>> Regards,
>>>
>>> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
>>> news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
>>>> Hello !!!
>>>>
>>>> I have a DbfDataset that i use to open a table A or a table B as the
>>>> user shooses one or another...To do that i close the Dataset, change
>>>> the table name and open it again. It works. The problem is that
>>>> although the name and records of the table is changed the
>>>> DbfDataset:aFields is never changed. To solve this I had to destroy the
>>>> Dataset object ( :End() ) and create it again.
>>>> Attached is a sample that shows that Dataset:aFields is allways the
>>>> same.
>>>> Is this the normal behavior ?
>>>> TIA.
>>>> Aguiar !!!
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>

DataSet:Close()

Publicado: Lun Jul 24, 2006 11:49 am
por Aguiar Costa
Ignacio,
I understand that. It just took me a lot of time to see what was happening.
Maybe this should be stressed out in the help files.
Thanks.
Aguiar !!!
"Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
news:44c494ed$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
> Aguiar,
>
> If you change the dataset table name you should destroy de DataSet first
> with the Destroy() method
>
> I am not sure if we should completely reset the DataSet when its table
> name is changed, since you will also lose any calculated field for
> example. I prefer to leave it how it is. Suppose the new table has the
> same structure that the old one (very usual I am afraid). In that case for
> sure you will not want to lose that information, ans some other users will
> complain about it.
>
> Regards,
>
> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
> news:44c48b4c$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>> Ignacio,
>>
>> But if the Dataset table is changed, shouldn't the fields related to it
>> be changed automatically ?
>> When the Dataset is set to open what's the logic of having :aFields with
>> the content of another table ??? ...maybe it should generate an error !!!
>> Regards.
>> Aguiar !!!
>>
>> "Ignacio Ortiz de Zúñiga" <NoName@xailer.com> escreveu na mensagem
>> news:44c47b01$[email=1@news.xailer.com...]1@news.xailer.com...[/email]
>>> Aguiar,
>>>
>>> That is completely normal. Is the standard behaviour. The fact that the
>>> DataSet is closed it does not mean is completely destroyed.
>>>
>>> Regards,
>>>
>>> "Aguiar" <aguiar.costa@sisbit.pt> escribió en el mensaje
>>> news:[email=44c12a04@news.xailer.com...]44c12a04@news.xailer.com...[/email]
>>>> Hello !!!
>>>>
>>>> I have a DbfDataset that i use to open a table A or a table B as the
>>>> user shooses one or another...To do that i close the Dataset, change
>>>> the table name and open it again. It works. The problem is that
>>>> although the name and records of the table is changed the
>>>> DbfDataset:aFields is never changed. To solve this I had to destroy the
>>>> Dataset object ( :End() ) and create it again.
>>>> Attached is a sample that shows that Dataset:aFields is allways the
>>>> same.
>>>> Is this the normal behavior ?
>>>> TIA.
>>>> Aguiar !!!
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>