🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Problem with ttParadox Table

#3185
From: Gunter Gemmel
Date: Mon, 02 Dec 2002 18:23
46 lines
2442 bytes
I create a ttParadox Table during runtime with three fields "author",
"description", "phrase" (memo). The author field should not be unique but
cppbuilder forces me to set it unique, because otherwise the program
produces errors. What am I doing wrong? In general: No field needs to be
unique but how can I set this.

Here is my code for creating the table:

Table->Active = false;
    Table->DatabaseName = Dir;
    Table->TableType = ttParadox;
    Table->TableName = "Aphorism";

    if (!Table->Exists) {
        Table->FieldDefs->Clear();

        TFieldDef *pNewDef = Table->FieldDefs->AddFieldDef();
        pNewDef->Name = "Author";
        pNewDef->DataType = ftString;
        pNewDef->Size = 255;

        pNewDef = Table->FieldDefs->AddFieldDef();
        pNewDef->Name = "Description";
        pNewDef->DataType = ftString;
        pNewDef->Size = 255;

        pNewDef = Table->FieldDefs->AddFieldDef();
        pNewDef->Name = "Phrase";
        pNewDef->DataType = ftMemo;
        pNewDef->Size = 50;

        Table->IndexDefs->Clear();
        Table->IndexDefs->Add("Autor", "Author", TIndexOptions() <<
ixPrimary << ixUnique); // Here I have to use ixUnique otherwise the program
produces errors
        Table->IndexDefs->Add("Beschreibung","Description", TIndexOptions()
<< ixUnique);

        Table->CreateTable();

        Application->MessageBox("Neue Datenbank wurde angelegt.", "Gungem
Aphorism", MB_OK | MB_ICONINFORMATION);
    }

Thank you for your help!
Gunter.
Technical Details
Message-ID: <3deba522@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.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,2ff84a7dbf38ea0,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-12-02 10:33:52 PST
From: "Gunter Gemmel" <info@gungem.de>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Problem with ttParadox Table 
Date: Mon, 2 Dec 2002 19:23:26 +0100
Lines: 52
Organization: Gungem
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: 217.88.253.183
Message-ID: <3deba522@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1038853410 217.88.253.183 (2 Dec 2002 10:23:30 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail