🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Creating a table dynamically with ADO

#2670
From: Bryan
Date: Wed, 14 May 2003 18:26
28 lines
1755 bytes
Hi,

I am trying to switch BDE components over to ADO components in my C++Builder 6.0 software.  

My software dynamically creates a table in an Access (switching from Access97 to 2000) database based on user input.

In BDE, I used a TTable component to create a table:

Form1->NewTable1->FieldDefs->Clear();       // Clear defined fields

TFieldDef *pNewDef = Form1->NewTable1->FieldDefs->AddFieldDef();      // Add UniqueID field
pNewDef->Name = "UniqueID";
pNewDef->DataType = ftString;
pNewDef->Size = 10;
pNewDef->Required = false;

..

Form1->NewTable1->CreateTable();

I tried to switch to a TADOTable component to do the same thing but I receive a compile error
"E2247 'TCustomADODataSet::FieldDefs' is not accessible"

Also, there is no CreateTable method for TADOTable.

Am I on the right path?  Is this the best way to do this? Any help would be very much appreciated.
Thanks in advance.
 
Technical Details
Message-ID: <3ec28a6e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,c03844264cac6a97,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-05-14 11:30:25 PST
From: "Bryan" <chi_bryan@hotmail.com>
Sender: "Bryan" <chi_bryan@hotmail.com>
Reply-To: "Bryan" <chi_bryan@hotmail.com>
Subject: Creating a table dynamically with ADO 
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 209.139.228.161 209.139.228.161    
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3ec28a6e$1@newsgroups.borland.com>
Date: 14 May 2003 11:26:54 -0700
X-Trace: newsgroups.borland.com 1052936814 207.105.83.65 (14 May 2003 11:26:54 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!newsgroups.borland.com!not-for-mail