Subject | Re: [IBO] Importing data from duplicate database |
---|---|
Author | Woody |
Post date | 2007-03-08T16:47:34Z |
From: "Ed Dressel" <Dressel@...>
of the primary tables first.
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)
>I need to import data from a different database. I am creating a classI don't think you need to know the PK and FKs as long as you copy the data
> 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.
of the primary tables first.
>Something like this: (copy record from IBData1 to IBData2)
> 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?
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)