Results 1 to 5 of 5

Thread: MS Access : RENAME COLUMN

  1. #1

    Question MS Access : RENAME COLUMN

    Hi,

    Ik heb een MS Access 2002 databeest waarin ik een kolom wil renamen en gebruik daarvoor de volgende statement in m'n query:

    ALTER TABLE mijntabel RENAME COLUMN veld1 TO veld2;

    Heb 237823782 sites gezien waar het zo als voorbeeld staat bij de uitgebreide uitleg, maar ik krijg steevast een ODBC foutmelding: Syntax error in ALTER TABLE statement.
    Terwijl het syntaxisch gezien toch wel juist is.. lijkt me

    Is er misschien ngo een andere manier om een kolom te renamen?

  2. #2
    Doe je dan wel een ExecSQL ipv een Open?
    Marcel

  3. #3
    Yea
    zo ziet me statement dr uit

    procedure RenameColumn(OldName, NewName: String);
    begin
    qrVeld.SQL.Clear;
    qrVeld.SQL.Add('ALTER TABLE TabelBla RENAME COLUMN ' + OldName + ' TO ' + NewName);
    qrVeld.Prepare;
    qrVeld.ExecSQL;
    qrVeld.UnPrepare;
    end;

    zou toch goed moeten zijn of niet?

    iekniebegraip

  4. #4
    Old Navigator Matthijs's Avatar
    Join Date
    Mar 2001
    Location
    Ede, NL. Delphi: Delphi 7/2005 :). Matthijs schrijf je Matthijs
    Posts
    2,199
    In Access 2000 was deze feature nog niet aanwezig en in SQLServer 2000 moet dat gebeuren met sp_rename [tabel].[kolomnaam] 'Nieuwe naam' 'COLUMN'.
    Dus weet je zeker dat dit ondersteund wordt?
    What's in a sig?

    Would my posting be less valuable if it didnot have a sig? (Vrij naar William S.)

    Let op de kleine lettertjes. For all postings: e&oe!
    This program performed an illegal function, the police are on their way

  5. #5
    Dat denk ik niet dan he (dattet ondersteund wordt).. vandaar mijn vraag of er geen andere manier is om dmv code de naam van een kolommetje te veranderen in een access DB, maar ook dat lijkt me onwaarschijnlijk anders was het wel gemeld inmiddles boehoe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 13
    Last Post: 21-Apr-04, 15:50
  2. Replies: 3
    Last Post: 04-Aug-03, 12:06
  3. Koppeling met MS Access: Access SQL gebruiken?
    By Puc conDoin in forum Databases
    Replies: 9
    Last Post: 08-May-03, 03:10
  4. Convert from access 97 to access 2000
    By ElDJ in forum Databases
    Replies: 11
    Last Post: 14-Mar-03, 11:21
  5. Access Violation, waarom?
    By PsychoMark in forum Algemeen
    Replies: 5
    Last Post: 23-Apr-02, 10:15

Bookmarks

Posting Permissions

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