Re: Creating a table with multiple key and boolean fields in SQL



You can put the PK in the Create statement
CREATE TABLE ThirdTable (Field1 TEXT, Field2 TEXT, Field3 INTEGER
CONSTRAINT MyFieldConstraint PRIMARY KEY (Field1,Field2));(example is VBA,
so from delphi, might need bit of adjusting, but basically, this is
it)"Boolean" in Access is "Yes/No"Lee-Z
"Dave Blake" <barnswood@xxxxxxxxxxx> wrote in message
news:42e49850@xxxxxxxxxxxxxxxxxxxxxxxxx
> I'm having problems using DDL SQL commands via ADO onto an Access mdb
> file.
> Can someone point me at a reference source for the supported syntax etc.?
>
> Or specifically tell me how to create a table with multiple field primary
> key and integer (not longint) and boolean fields.
>
> It is something like
> CREATE TABLE MyTable (Field1 INTEGER, Field2 INTEGER, .... FieldX BOOLEAN)
>
> but "Boolean" is wrong and Integer gives me LongInt fields.
> Then followed by
> ALTER TABLE MyTable
> ADD CONSTRAINT PK_code PRIMARY KEY (field1, field2)
> to add the primary key, or can I do it in the create statement somehow?
>
> Thanks
> Dave
>
>


.



Relevant Pages

  • Re: When does foreign key update?
    ... running a join query on ... On the form, on an insert, filling a value for field1 or field2 ... creates a primary key for tbl1. ... field3, the foreign key gets set to the primary automatically. ...
    (microsoft.public.access.formscoding)
  • Re: When does foreign key update?
    ... running a join query on ... On the form, on an insert, filling a value for field1 or field2 ... creates a primary key for tbl1. ... field3, the foreign key gets set to the primary automatically. ...
    (microsoft.public.access.formscoding)
  • Re: Selecting non-continuous records in a continuous form
    ... Then use a query or a filter to choose just the marked records. ... Field1: contains the primary key of the Source Table ... Field2: contains an identifier ...
    (microsoft.public.access.modulesdaovba)
  • Re: When does foreign key update?
    ... running a join query on ... On the form, on an insert, filling a value for field1 or field2 ... creates a primary key for tbl1. ... field3, the foreign key gets set to the primary automatically. ...
    (microsoft.public.access.formscoding)
  • Re: multiple field, primary key
    ... field3 text ... The primary key is the foreign key in several other tables. ... enters field1, field2, field3, and the afterupdate event of each is: ...
    (microsoft.public.access.tablesdbdesign)