🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2968

Re: Importing data form diferent tables and database types

#2968
From: In�s Fern�ndez
Date: Wed, 19 Feb 2003 08:16
43 lines
2522 bytes
Thanks.
I was doing something like that, but now I am doing the insertion with a
TADOCommand that seems to be a little faster.
What I would like to know is if is there any structure that would allow me
to copy all records from the DBase table to it, then add two more fields to
each record with some calculations, and after that save all records to de
SQL server table. I am thinking about an intermediary, or something like
that.
Thanks again:
Ines

"Max Luzin" <maksim.luzin@wsy.lt> escribi� en el mensaje
news:3e51e988@newsgroups.borland.com...
>
> "In�s Fern�ndez" <ifernandezmed@terra.es> wrote in message
> news:3e4cf489$1@newsgroups.borland.com...
> > Hi all!
> > I am working in a program that must import data from a DBase table to
> > another table in an SQL server database. The second table has two more
> > fields than the first one, but the rest of the fields are the same.
>
>
> You can use two ADO datasets: one for import (dBase) and second for export
> (SQL Server). Something like this:
>
> ImpTable->First();
> while (!ImpTable->Eof)
> {
>     // Process each record here
>     ExpTable->Append();
>     ExpTable->Fields->Fields[0]->Value = ... // Process field values from
> ImpTable (conversion, etc)
>     ExpTable->Fields->Fields[1]->Value = ...
>     ExpTable->Fields->Fields[2]->Value = ...
>     // ... and so on
>     ExpTable->Post();
>     ImpTable->Next();
> }
>
> Max
>
>
>
Technical Details
Message-ID: <3e533d56@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e4cf489$1@newsgroups.borland.com> <3e51e988@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,5718363b56ae1b18
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-02-19 00:40:12 PST
From: "In�s Fern�ndez" <ifernandezmed@terra.es>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3e4cf489$1@newsgroups.borland.com> <3e51e988@newsgroups.borland.com>
Subject: Re: Importing data form diferent tables and database types
Date: Wed, 19 Feb 2003 09:16:23 +0100
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 80.59.94.142
Message-ID: <3e533d56@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1045642582 80.59.94.142 (19 Feb 2003 00:16:22 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail