Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Creating at TAdsTable

5 posts in Delphi Last posting was on 2003-08-28 17:34:56.0Z
Philip Brindle Posted on 2003-08-27 20:33:31.0Z
Reply-To: "Philip Brindle" <philipbrindle@aka-group.com>
From: "Philip Brindle" <philipbrindle@aka-group.com>
Newsgroups: advantage.delphi
Subject: Creating at TAdsTable
Date: Wed, 27 Aug 2003 16:33:31 -0400
Lines: 13
Organization: AKA Group
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 64.235.99.83
Message-ID: <3f4d15f7@solutions.advantagedatabase.com>
X-Trace: 27 Aug 2003 14:35:03 -0700, 64.235.99.83
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!64.235.99.83
Xref: solutions.advantagedatabase.com Advantage.Delphi:13798
Article PK: 1107233

Hello all,

I am using C++Builder 5 and was wondering how can I create a TAdsTable
dynamically and add a couple of fields? I need to code a temporary table
and store some data, nothing too fancy. A small C++ example would be great
too.

Thanks for any help you can provide.

Best regards,
Philip../


Joachim Duerr (ADS Support) Posted on 2003-08-28 08:48:19.0Z
From: "Joachim Duerr (ADS Support)" <jojo.duerr@gmx.de>
Subject: Re: Creating at TAdsTable
Newsgroups: Advantage.Delphi
References: <3f4d15f7@solutions.advantagedatabase.com>
Organization: Extended Systems GmbH
User-Agent: XanaNews/1.15.6.2
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 195.2.185.25
Message-ID: <3f4db3c3@solutions.advantagedatabase.com>
Date: 28 Aug 2003 01:48:19 -0700
X-Trace: 28 Aug 2003 01:48:19 -0700, 195.2.185.25
Lines: 44
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!195.2.185.25
Xref: solutions.advantagedatabase.com Advantage.Delphi:13799
Article PK: 1107236


Philip Brindle wrote in <3f4d15f7@solutions.advantagedatabase.com> :

> I am using C++Builder 5 and was wondering how can I create a TAdsTable
> dynamically and add a couple of fields? I need to code a temporary
> table and store some data, nothing too fancy. A small C++ example
> would be great too.

I've only examples for elphi and my C++ time is far back, but I try to
translate it into C++ syntax:

Create a new project with one Form, add one TAdsConnection and one
TAdsTable component to it. Add ACE32BOR.LIB to your project.

<SNIP>
{
//connect to the database
AdsConnection1->ConnectPath = "s:\\data";
AdsConnection1->Connect();
//link the table to the database
AdsTable1->DatabaseName = "AdsConnection1";
AdsTable1->TableName = "customer.adt";

//Setup the table structure
AdsTable1->FieldDefs->Clear();
AdsTable1->FieldDefs->Add("ID", ftAutoInc, 0, false);
AdsTable1->FieldDefs->Add("Prename", ftString, 30, false);
AdsTable1->FieldDefs->Add("Surname", ftString, 30, false);
AdsTable1->FieldDefs->Add("Street", ftString, 30, false);
AdsTable1->FieldDefs->Add("ZIP", ftString, 6, false);
AdsTable1->FieldDefs->Add("City", ftString, 30, false);

//Create the table
AdsTable1->CreateTable();

//Open the table
AdsTable1->Open();
}</SNIP>

--
Joachim Duerr
Lead ADS Support, Extended Systems GmbH, Germany
advantage[AT]extendsys.de
- posted with Xananews 1.15.6.2 -
!!! ADS 7 Beta now available !!!


Brian Posted on 2003-08-28 12:58:23.0Z
From: "Brian" <NoEmail@NoEmail.com>
Newsgroups: Advantage.Delphi
References: <3f4d15f7@solutions.advantagedatabase.com> <3f4db3c3@solutions.advantagedatabase.com>
Subject: Re: Creating at TAdsTable
Date: Thu, 28 Aug 2003 07:58:23 -0500
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4920.2300
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300
NNTP-Posting-Host: 216.152.27.55
Message-ID: <3f4dfcf2@solutions.advantagedatabase.com>
X-Trace: 28 Aug 2003 07:00:34 -0700, 216.152.27.55
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!216.152.27.55
Xref: solutions.advantagedatabase.com Advantage.Delphi:13800
Article PK: 1107235

Hello Joachim,

You way of doing that is different than mine and I am curious if your method
is any more efficient. Is it better to use FieldDefs? Here is how I do it:

With DataModule1.StatementTable do begin
AdsCreateTable(sDataFolder+sTableName, ttAdsADT, ANSI, ADS_DEFAULT,
'StatementNum , Char, 10;' + // Primary key
'AccountNum , Char, 10;' +
'SvcFrom , Date;' +
'SvcTo , Date;' +
'AmountDue , CurDouble, 8;' +
'DueDate , Date;' +
'ChangedBy , Char, 10;'+
'ChangedDate , Date;' +
'Printed , Char, 1;');
if FileExists(sDataFolder+sTablename) then begin
Exclusive := True;
Open;
// Do something here
close;
end;

Regards,

Brian

"Joachim Duerr (ADS Support)" <jojo.duerr@gmx.de> wrote in message
news:3f4db3c3@solutions.advantagedatabase.com...
> Philip Brindle wrote in <3f4d15f7@solutions.advantagedatabase.com> :
>
> > I am using C++Builder 5 and was wondering how can I create a TAdsTable
> > dynamically and add a couple of fields? I need to code a temporary
> > table and store some data, nothing too fancy. A small C++ example
> > would be great too.
>
> I've only examples for elphi and my C++ time is far back, but I try to
> translate it into C++ syntax:
>
> Create a new project with one Form, add one TAdsConnection and one
> TAdsTable component to it. Add ACE32BOR.LIB to your project.
>
> <SNIP>
> {
> //connect to the database
> AdsConnection1->ConnectPath = "s:\\data";
> AdsConnection1->Connect();
> //link the table to the database
> AdsTable1->DatabaseName = "AdsConnection1";
> AdsTable1->TableName = "customer.adt";
>
> //Setup the table structure
> AdsTable1->FieldDefs->Clear();
> AdsTable1->FieldDefs->Add("ID", ftAutoInc, 0, false);
> AdsTable1->FieldDefs->Add("Prename", ftString, 30, false);
> AdsTable1->FieldDefs->Add("Surname", ftString, 30, false);
> AdsTable1->FieldDefs->Add("Street", ftString, 30, false);
> AdsTable1->FieldDefs->Add("ZIP", ftString, 6, false);
> AdsTable1->FieldDefs->Add("City", ftString, 30, false);
>
> //Create the table
> AdsTable1->CreateTable();
>
> //Open the table
> AdsTable1->Open();
> }</SNIP>
>
> --
> Joachim Duerr
> Lead ADS Support, Extended Systems GmbH, Germany
> advantage[AT]extendsys.de
> - posted with Xananews 1.15.6.2 -
> !!! ADS 7 Beta now available !!!


Joachim Duerr (ADS Support) Posted on 2003-08-28 14:12:10.0Z
From: "Joachim Duerr (ADS Support)" <jojo.duerr@gmx.de>
Subject: Re: Creating at TAdsTable
Newsgroups: Advantage.Delphi
References: <3f4d15f7@solutions.advantagedatabase.com> <3f4db3c3@solutions.advantagedatabase.com> <3f4dfcf2@solutions.advantagedatabase.com>
Organization: Extended Systems GmbH
User-Agent: XanaNews/1.15.6.2
X-Face: ,QMv7[luB)BpWAQ~:"kw6n%0ieY63.:g2K3n~8ky0;||5Xle*Xq+=~<Fy:0CVC2nx@8~vZ
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 195.2.185.25
Message-ID: <3f4dffaa@solutions.advantagedatabase.com>
Date: 28 Aug 2003 07:12:10 -0700
X-Trace: 28 Aug 2003 07:12:10 -0700, 195.2.185.25
Lines: 17
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!195.2.185.25
Xref: solutions.advantagedatabase.com Advantage.Delphi:13801
Article PK: 1107237


Brian wrote in <3f4dfcf2@solutions.advantagedatabase.com> :

> You way of doing that is different than mine and I am curious if your
> method is any more efficient. Is it better to use FieldDefs? Here is
> how I do it:

Brian,
if you use the FieldDefs, it's more Delphi-Like. Your way is ok. But
standard-Delphi components (TTable) don't have the method
AdsCreateTable;)

--
Joachim Duerr
Lead ADS Support, Extended Systems GmbH, Germany
advantage[AT]extendsys.de
- posted with Xananews 1.15.6.2 -
!!! ADS 7 Beta now available !!!


Philip Brindle Posted on 2003-08-28 17:34:56.0Z
Reply-To: "Philip Brindle" <philipbrindle@aka-group.com>
From: "Philip Brindle" <philipbrindle@aka-group.com>
Newsgroups: advantage.delphi
References: <3f4d15f7@solutions.advantagedatabase.com>
Subject: Re: Creating at TAdsTable
Date: Thu, 28 Aug 2003 13:34:56 -0400
Lines: 28
Organization: AKA Group
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 64.235.99.83
Message-ID: <3f4e3d83@solutions.advantagedatabase.com>
X-Trace: 28 Aug 2003 11:36:03 -0700, 64.235.99.83
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!64.235.99.83
Xref: solutions.advantagedatabase.com Advantage.Delphi:13802
Article PK: 1107238

Hi again,

Thanks all of you for the help!

Best regards,
Philip../

"Philip Brindle" <philipbrindle@aka-group.com> wrote in message
news:3f4d15f7@solutions.advantagedatabase.com...
> Hello all,
>
> I am using C++Builder 5 and was wondering how can I create a TAdsTable
> dynamically and add a couple of fields? I need to code a temporary
table
> and store some data, nothing too fancy. A small C++ example would be
great
> too.
>
> Thanks for any help you can provide.
>
> Best regards,
> Philip../
>
>