🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: dataset in memory

#4545
From: Giuliano
Date: Sat, 24 Nov 2001 11:30
39 lines
1886 bytes
On Fri, 23 Nov 2001 17:02:32 +0100, "Luca Casotti" <luca.casotti@iol.it>
wrote:

>is possible to create a dataset with no connecton to a database on disk, but
>only in RAM? if so how?
>

Ciao Luca,

    as far as I know, it's possible. Try to drop a TADODataSet 
onto a TDataModule (or TForm), then rename it (e.g. DS). Then 
try to write something like the following (untested) code 
snippet:

    // Clear all field
    DS->FieldDefs->Clear();

    // Create the first field
    TFieldDef *NewDef = DS->FieldDefs->AddFieldDef(); 
    NewDef->Name = "Field1";  // Field name
    NewDef->DataType = ftInteger; // Field Type

    // Create the 2nd field
    NewDef = DS->FieldDefs->AddFieldDef();
    NewDef->Name = "Field2";  // Field name
    NewDef->DataType = ftString; // Field Type
    NewDef->Size = 30;  // Length

    // and so on ... 

    // Now, here we create the recordset. Don't try to open DS;
    // just call TADODataSet::CreateDataSet();
    DS->CreateDataSet();

HTH

Ciao!

Giuliano
Technical Details
Message-ID: <3c01843b.297570053@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3bfe818c_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,c403ea0dd7065cf5
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-11-24 03:38:52 PST
From: gcardinali@remove.adhoc.net (Giuliano)
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: dataset in memory
Date: Sat, 24 Nov 2001 11:30:48 GMT
Message-ID: <3c01843b.297570053@newsgroups.borland.com>
References: <3bfe818c_2@dnews>
X-Newsreader: Forte Agent 1.5/32.451
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 194.183.68.73
X-Trace: dnews 1006601835 194.183.68.73 (24 Nov 2001 03:37:15 -0800)
Lines: 39
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews