🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #1017

Re: Copy Data from DBGrid1 to DBGrid2

#1017
From: Jan Karpisek
Date: Mon, 26 Jun 2000 00:00
45 lines
1569 bytes
Hi,
I think that you just need correct SQL statement like
INSERT INTO t2 SELECT (R1, R2, ...) FROM t1 WHERE conditions

or at client side something like this
Q1->Close();
Q1->Open();    /* Select connected to Grid1 */
Q1->DisableControls();
while ( !Q1.Eof )
{
  if ( conditions ) CopyQuery.ExecSQL();
  Q1->Next();
}
Q1->EnableControls();
Q2->Close();
Q2->Open();  /*refresh Grid2*/

Jan

> This is the PROBLEM:
>
> 1. I have 2 forms, F1 and F2.
> 2. F1 has a Table, Query, DataSource and DBGrid with 14 columns [C] and
more
> than 110,000 rows [R] records
> 3. If I want to access the C1R1 only to do some �string matching and
> analysis�. If  C1R1 met my requirements, I want to copy the hold R1 (Here
is
> C1R1, C2R1, C3R1� C14R1) to F2�s DBGrid.
> 4. After that, I need to access the second record, C1R2 and do the same
> thinks until the last record. (If meet, copy to F2, else just does
nothing).
> 5. What I need to do with F2 and how the coding works?
>
>
>
>
>
> Thanks.
>
> Regards,
> Nelson
>
>
>
Technical Details
Message-ID: <39572142@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39530d7f@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fcd2b,5f7147f3b037a0f6
X-Google-Attributes: gidfcd2b,public
From: "Jan Karpisek" <jkarpisek@inprise.cz>
Subject: Re: Copy Data from DBGrid1 to DBGrid2
Date: 2000/06/26
Message-ID: <39572142@dnews>
X-Deja-AN: 639043755
References: <39530d7f@dnews>
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
X-Trace: 26 Jun 2000 02:24:18 -0800, 127.0.0.1
Organization: Borland Inprise CZ
Newsgroups: borland.public.cppbuilder.database.multi-tier