🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

simple loop to copy all rows from one table to another. (using TVarRec)

#5099
From: Doulas Stites
Date: Wed, 11 Jul 2001 11:57
29 lines
1701 bytes
I have a simple question that perhaps you can help me with. I wrote this
little loop
to copy an oracle dataset to a another table and it gives me a table with
all blank rows.

What could be the problem?

ods->Open(); // open the oracle dataset
Table1->Open();
Variant vv;
TVarRec *v = new TVarRec[ods->RecordCount];


for (row=0; row < ods->RecordCount; row++)
      { for (col=0; col < ods->FieldCount; col++)
         { vv = ods->Fields->Fields[col]->AsVariant; //did this so I could
see values during debug
           v[col] = vv ;
         }

       Table1->AppendRecord(v,ARRAYSIZE(v) - 1);
       ods->Next();
      }

   Table1->Close();
   Table1->Open(); // The table has all blank rows!!!

Thank you in advance.
doug
Technical Details
Message-ID: <3b4c3fc2_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,28bedb73628f75d6,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-07-11 05:06:14 PST
Reply-To: "Doulas Stites" <dlstites@ix.netcom.com>
From: "Doulas Stites" <dlstites@ix.netcom.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: simple loop to copy all rows from one table to another. (using TVarRec)
Date: Wed, 11 Jul 2001 07:57:41 -0400
Lines: 32
Organization: Avatar
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 165.247.116.214
Message-ID: <3b4c3fc2_2@dnews>
X-Trace: dnews 994852802 165.247.116.214 (11 Jul 2001 05:00:02 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews