Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111

    Unanswered: Change field lenght with VBA code

    1. I need to change the field lenght in a table
    2. I need to create a new field in the same table

    All this must be done with VBA code.

    The .mdb has a front-end and a back-end.

    Thank you very much for your help and opinion.

    Regards,

    Jose

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Have a look to AlterTable Statement.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'm pretty certain you cannot alter a table in a back end database, as I don't believe that you can secure a lock on the table. You could do it from the back end, but you would have to make sure all consumers of that data are locked out.
    There was a similar question on this thread within the last 2..3 weeks

  4. #4
    Join Date
    Jul 2003
    Location
    Portugal
    Posts
    111
    Quote Originally Posted by healdem
    I'm pretty certain you cannot alter a table in a back end database, as I don't believe that you can secure a lock on the table. You could do it from the back end, but you would have to make sure all consumers of that data are locked out.
    There was a similar question on this thread within the last 2..3 weeks
    I need this to update a .mdb file. So, my front-end (will be a new front-end) will change the back-end table values in the first time is runned. In this way I think data is not locked.

    Am I thinking right? I need to test before saying anything more...

    Thank you for your opinion.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I'm pretty certain you cannot update tables that are not part of the current database. Ie you cannot modify linked tables. It may be possible to modify non local tables by running the DDL programmatically providing the tables are not linked at the time. Just I theory, I haven't tested it - perhaps you might like to!

    It does beg the question why would you want to change a table(s) in your back end database - it would suggst to mne that you physical, and possible logical designs are not correct.

Posting Permissions

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