Access2000(add column to linked table)

  • Hi ,

    There is an already linked table, and it wont allow me to add columns in the normal 'insert column' way.

    Need help!!

  • I'm going to assume that you are using an MDB file, with a SQL Server linked table.  I've seen this behavior before, but it could be caused by any number of issues.

    If this is something you need to do on a regular basis, you should look into your connection and security settings.  That's likely where the issue lies.

    If this is a one-time (or infrequent) issue, I would recommend going into Enterprise Manager to insert the column.  Or, issuing the DDL SQL directly.  Nine times out of ten, that's just going to be a lot easier.

  • I am using an MDB file, with a Microsoft Access 2000 linked table......

  • You can't add columns to a linked table through the MDB interface.

    You can issue DDL SQL using the ADODB.CONNECTION object. 

     

        Dim myconn As New ADODB.Connection

        With myconn

            .ConnectionString = "DRIVER=SQL Server;SERVER=HOUSQL1;DATABASE=EPRD_Training;Trusted_Connection=Yes"

            .Open

            .Execute "ALTER TABLE MyTable ADD  [MyNewColumn] [varchar](25) NULL"

            .Close

        End With

        Set myconn = Nothing

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply