Subject Re: [IBO] Importing data from duplicate database
Author Woody
From: "Ed Dressel" <Dressel@...>
>I need to import data from a different database. I am creating a class
> structure that provides the information to move the data over (I say
> this so that if there is an easier way, I would appreciate any tips).
> It includes the PK and FK relationships.

I don't think you need to know the PK and FKs as long as you copy the data
of the primary tables first.

>
> What I need to do is copy the contents of one record from one databse
> table to another. I would like to do it abstractly, not knowing
> anything about the field list in the database. I will know the PK and
> FK fields and values.
>
> Any way to easily do this? Any tips?

Something like this: (copy record from IBData1 to IBData2)

for x := 0 to IBData1.FieldCount-1 do
if Assigned(IBData2.FindField(IBData1.Fields[x].FieldName)) then
IBData2.FieldByName(IBData1.Fields[x].FieldName).Assign(
IBData1.Fields[x]);

I have a simple app I put together for copying records between 2 databases
but it's not pretty and it's so not bullet proof because I only use it for
my own personal things. I could send it to you so you can get some ideas if
you want. (Email me privately if you want me to send it to you)

HTH
Woody (TMW)