Results 1 to 5 of 5

Thread: how to add column

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    101

    how to add column

    hi,

    just want to ask how to add a column programmatically using ADO. Im trying to use the code below but it causes error.

    dbconnTmp.Execute ("alter table table1 add column cd C(4)")

    what's wrong with my code?

    pls. help ..thanks in advance

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629

    Re: how to add column

    Originally posted by tonio
    hi,

    just want to ask how to add a column programmatically using ADO. Im trying to use the code below but it causes error.

    dbconnTmp.Execute ("alter table table1 add column cd C(4)")

    what's wrong with my code?

    pls. help ..thanks in advance
    what is C(4) ?

    thats not a valid field type, is it?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    101
    hi,

    i thought C(4) stands for field type character and field length = 4. What should i use?

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Try char(4) or varchar(4)

    Best regards

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Philippines
    Posts
    101
    yes, it already worked! thanks a lot

Posting Permissions

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



Click Here to Expand Forum to Full Width