🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How do I submit an SQL statement to an Access database using code?

#2081
From: Viatcheslav V. Vassiliev
Date: Sat, 01 Nov 2003 07:11
42 lines
2555 bytes
Primary key is always unique key - remove primary key definition from
TABLE2.NDX.

//------------------------------------------
Regards,
Viatcheslav V. Vassiliev
http://www.managed-vcl.com
http://www.oledbdirect.com



"Ted Byers" <r.ted.byers@sympatico.ca> �������/�������� � ��������
���������: news:3fa2c520$1@newsgroups.borland.com...
>
> > var conn = new ActiveXObject("ADODB.Connection");
> > conn.Open(connStr);
> > conn.Execute("CREATE TABLE JUNK (NDX COUNTER(1, 1) NOT NULL CONSTRAINT
> > PRIMKEY PRIMARY KEY, " +
> >  "NAMEVALUE VARCHAR(60) WITH COMPRESSION NOT NULL)");
> > conn.Execute("CREATE TABLE TABLE2 (NDX INTEGER NOT NULL CONSTRAINT
PRIMKEY
> > PRIMARY KEY, " +
> >  "COL2 VARCHAR(20) WITH COMPRESSION, CONSTRAINT FORKEY FOREIGN KEY (NDX)
> > REFERENCES JUNK(NDX) " +
> >  "ON UPDATE CASCADE ON DELETE SET NULL)");
> > conn = null;
> > //----------------------------
>
> Thanks loads.  I translated this, and as expected it works, but when I
> examined the resulting database using MS Access, I saw one problem.  In
the
> table TABLE2, NDX is shown as being indexed, as expected, but without
> duplicates.  This is inconsistent with what is shown in the relationships
> diagram, where the relationship is shown as being one (in table JUNK) to
> many (in table TABLE2).  How would I change the SQL you show to change NDX
> in TABLE2 to being indexed but with duplicates being allowed?
>
> Cheers,
>
> Ted
>
>
Technical Details
Message-ID: <3fa37ceb$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3fa29d35$1@newsgroups.borland.com> <3fa2b26b@newsgroups.borland.com> <3fa2c520$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,d26ef4716ff1429f
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-01 01:39:23 PST
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3fa29d35$1@newsgroups.borland.com> <3fa2b26b@newsgroups.borland.com> <3fa2c520$1@newsgroups.borland.com>
Subject: Re: How do I submit an SQL statement to an Access database using code?
Date: Sat, 1 Nov 2003 10:11:13 +0300
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.234.218.42
Message-ID: <3fa37ceb$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067678955 213.234.218.42 (1 Nov 2003 01:29:15 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail