Results 1 to 9 of 9
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Add Column in Alter Table (Access XP)

    Can somebody help me and give me a solution to the following SQL:
    ALTER TABLE [Delivery Point] ADD COLUMN [DefaultDelPoint] [Yes/No]
    I am trying to add a new column that is a boolean (Yes/No), bit it comes back with error:

    Runtime error 3292
    Syntax error in field definition.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add Column in Alter Table (Access XP)

    Instead of [Yes/No], use BIT as data type.

    You can find a list of SQL data types in the online help, although - as usual - it can be tricky to locate it. If you're lucky, you'll find it under Microsoft Jet SQL Reference > Overview > SQL Data Types.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Add Column in Alter Table (Access XP)

    To use the Help <img src=/S/barf.gif border=0 alt=barf width=64 height=23> you have gotta be lucky.
    Where is Microsoft Jet SQL Reference addressed from?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add Column in Alter Table (Access XP)

    Type something like DoCmd or another specific Access item in a module window or in the Immediate window, and without moving the insertion point, press F1. When the Help window opens, switch to the Contents tab in the left hand pane (if you don't have a left hand pane in your help window, click the Show button (the second button in the toolbar of the help window.)

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Add Column in Alter Table (Access XP)

    This is now my statement:
    ALTER TABLE [Delivery Point] ADD COLUMN [DefaultDelPoint] Bit

    I now get error:
    Runtime error 3371
    Cannot find table or constraint

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add Column in Alter Table (Access XP)

    Are you sure that the name of the table (Delivery Point) is spelled absolutely correctly? The statement works for me if I substitute the name of an existing table.

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Add Column in Alter Table (Access XP)

    Yes the name of the table is spelt absolutely correctly, sorry about the facetious tone, but one starts to go a bit troppo when Access starts to play up (I'm assuming it's Access at this stage, guilty until proven innocent <img src=/S/grin.gif border=0 alt=grin width=15 height=15>).

    This is getting crazy, I will exit from the form then exit the database then go into the form at the point I'm trying to use that statement.

  8. #8
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Add Column in Alter Table (Access XP)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15> <img src=/S/ouch.gif border=0 alt=ouch width=15 height=15> <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15> Hans how silly do I feel, what I am trying to do is to address 3 different databases via the Database command and you guessed it, I was addressing the wrong database.

    Sorry for wasting your time.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Add Column in Alter Table (Access XP)

    Ah, I can go to sleep without worries now <img src=/S/snore.gif border=0 alt=snore width=32 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •