Results 1 to 4 of 4

Thread: Access SQL Make new fields

  1. #1

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Access SQL Make new fields

    I am now in charge of a large collection (about 50) MS Access 2000 databases with one or more uses in different parts of the country. Each database is exactly the same when shipped that is same tables and forms and a hell of a lot of data already in it.

    Now as we have split the database we can send updates to the front end to all these users

    " Missing DLL files on computers that don't allow you to install them..." that was / is a killer but that is not really my question just a side gripe.

    My question is this: I wish to create a new function for the database that goes like this.

    VB Code:
    1. Function UpdateShape(Table, NewField, Value) as boolean
    2. Docmd. er um er um duuur hmmmm

    What I want to do is construct a string conatining SQL.
    The SQL must create a new record in a field in a table and give all current fields a value.

    What format would my SQL take?
    ?
    'What's this bit for anyway?
    For Jono

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    ALTER TABLE tablename ADD columnname varchar(50)

    After that,

    UPDATE TABLE tablename SET columname = 'mendhak'

  3. #3

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    Thankyou very much I'll give it a try...
    ?
    'What's this bit for anyway?
    For Jono

  4. #4

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774
    Thanks again for the help I'm going to have very happy clients now.

    Just for other readers of this thread I found that the SQL pattern:

    Code:
    ALTER TABLE tablename ADD columnname varchar(50)
    
    After that, 
    
    UPDATE tablename SET columname = 'mendhak'
    worked best.

    It's only very slightly different to the original which was a vast help.
    ?
    'What's this bit for anyway?
    For Jono

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