Board index » delphi » Referential integrity on Paradox tables

Referential integrity on Paradox tables

Hello group,

I have a big problem with restructuring tables in code, with BDE API
function DbiDoRestructure.
When user selects new company, i have to make an alias for that company and
create all tables with the same structure as the tables in my applcation
base alias. User can make few company aliases. I wanted to use DbiCopyTable
to copy tables to the new alias, but then Referntial Integrity is lost. Then
i tried to use DbioDoRestructure (like in the BDE API help example) to add
Referential Integrities , after DbiCopyTable. When i go to Database Desktop
and open detail table to check the structure, Referential integrity is added
but when i double click on it then Database Desktop says that there is no
referential integrity master table, even it is copied and the referential
integrity fields are shown.
Why is that  happening, and how can i fix it?

Thanks in advance (and sorry for my incorrect english)

Radovan Radic

 

Re:Referential integrity on Paradox tables


In article <9nvdg6$fc...@news.eunet.yu>, chi...@eunet.yu says...

Quote
> Hello group,

> I have a big problem with restructuring tables in code, with BDE API
> function DbiDoRestructure.
> When user selects new company, i have to make an alias for that company and
> create all tables with the same structure as the tables in my applcation
> base alias. User can make few company aliases. I wanted to use DbiCopyTable
> to copy tables to the new alias, but then Referntial Integrity is lost. Then
> i tried to use DbioDoRestructure (like in the BDE API help example) to add
> Referential Integrities , after DbiCopyTable. When i go to Database Desktop
> and open detail table to check the structure, Referential integrity is added
> but when i double click on it then Database Desktop says that there is no
> referential integrity master table, even it is copied and the referential
> integrity fields are shown.
> Why is that  happening, and how can i fix it?

> Thanks in advance (and sorry for my incorrect english)

> Radovan Radic

I am not quite sure what are you trying to archive here.
If you need to copy tables to another alias, I suggest you create alias
and use TBatchMove. Then you can empty table if you don't need data.

Anyways, separation of tables with same structure not sounds as a good
move. Do you really need that?
For any additional information, mail me directly on Serbian language.

--
Best regards,
Emil Beli
http://www.greenhousemm.com

Re:Referential integrity on Paradox tables


On Sat, 15 Sep 2001 13:21:08 +0200, "Radovan Radic" <chi...@eunet.yu>
wrote:

Quote
>Hello group,

>I have a big problem with restructuring tables in code, with BDE API
>function DbiDoRestructure.
>When user selects new company, i have to make an alias for that company and
>create all tables with the same structure as the tables in my applcation
>base alias. User can make few company aliases. I wanted to use DbiCopyTable
>to copy tables to the new alias, but then Referntial Integrity is lost. Then
>i tried to use DbioDoRestructure (like in the BDE API help example) to add
>Referential Integrities , after DbiCopyTable. When i go to Database Desktop
>and open detail table to check the structure, Referential integrity is added
>but when i double click on it then Database Desktop says that there is no
>referential integrity master table, even it is copied and the referential
>integrity fields are shown.
>Why is that  happening, and how can i fix it?

It's not what you asked but what if you keep somewhere your empty
tables and just copy these empty tables to the new destination dir

Re:Referential integrity on Paradox tables


Quote
"Smola" <a...@inet.hr> wrote in message

news:3ba4938b.277562143@news.iskon.hr...

Quote
> On Sat, 15 Sep 2001 13:21:08 +0200, "Radovan Radic" <chi...@eunet.yu>
> wrote:

> >Hello group,

> >I have a big problem with restructuring tables in code, with BDE API
> >function DbiDoRestructure.
> >When user selects new company, i have to make an alias for that company
and
> >create all tables with the same structure as the tables in my applcation
> >base alias. User can make few company aliases. I wanted to use
DbiCopyTable
> >to copy tables to the new alias, but then Referntial Integrity is lost.
Then
> >i tried to use DbioDoRestructure (like in the BDE API help example) to
add
> >Referential Integrities , after DbiCopyTable. When i go to Database
Desktop
> >and open detail table to check the structure, Referential integrity is
added
> >but when i double click on it then Database Desktop says that there is no
> >referential integrity master table, even it is copied and the referential
> >integrity fields are shown.
> >Why is that  happening, and how can i fix it?

> It's not what you asked but what if you keep somewhere your empty
> tables and just copy these empty tables to the new destination dir

Yes, i ve been thinking that way, and this is solution, but i want it to be
"professional" :)
I could zip these tables, and unzip when i need it, but i have to deploy zip
and unzip dll files to make it.
Or i can have directory with these tables, and copy from it when i need it,
but i dont want to someone notice this directory with empty tables.
I think i am on the way to solve it, if i make it i'll post code here.

Thanks,
Radovan

Other Threads