Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009
    Posts
    37

    Unanswered: Syntax error rename column sql

    Hi

    I am trying to rename a column in my table and I keep on getting a syntax error message. This is very annoying since I have been sitting on this problem for ages now and I just cannot see what I am doing wrong!!!!!

    DoCmd****nSQL ("ALTER table tbl_holding RENAME COLUMN [Work Location#Work Location - Country] TO 'Work Location - Country';")


    Please help!

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    My first response is that is not valid SQL. You got a source?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ok, checked and it is not valid.
    Intermediate Microsoft Jet SQL for Access 2000

    You need to create the new one and drop the old one. If you have data in the table you need to update the new column before dropping the old one.

    Since you are changing names, I would recommend using alphanumerics only, and optionally underscore. No spaces or dashes.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Mar 2009
    Posts
    37
    Hi

    Thanks for the reply. Do you mind posting the link again. I could not access the last copy.

    s

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I think there is an error with MSDN. I have had trouble with other MS sites today. Google for "Jet Intermediate SQL". Use the Cached version. There are also Basic and Advanced SQL documents. They are excellent.

    It might seem rather obvious now, but fabricating your own syntax and then spending a day "debugging" it is not going to get yourself anywhere very fast. I know the syntax looks sensible enough but it's not any use if the application doesn't recognise it.

    Anyway, you know the docs to refer to now for JET DDL.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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