I usually call some DAO code like the following (needs error handling):
Function AddField(pstrTable As String, pstrField As String, _
intFieldType As DataTypeEnum) As Boolean
Dim db As DAO.Database
Dim td As DAO.TableDef
Dim strRemoteDB As String
Set db = CurrentDb
Set td = db.TableDefs(pstrTable)
If Len(td.Connect) > 0 Then
strRemoteDB = Mid(td.Connect, 11)
Set td = Nothing
Set db = OpenDatabase(strRemoteDB)
Set td = db.TableDefs(pstrTable)
End If
With td
.Fields.Append .CreateField(pstrField, intFieldType)
End With
Set td = Nothing
Set db = Nothing
End Function
--
Duane Hookom
MS Access MVP
"Allen Browne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You could try adding an IN clause, e.g.:
> ALTER TABLE Table1 IN 'c:\MyDatabase.mdb' ...
>
> If that doesn't work, you could OpenDatabase(), and run the SQL statement
> against that database variable.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Royce" <(E-Mail Removed)> wrote in message
> news:2A852F31-93A3-4A53-8E23-(E-Mail Removed)...
>>I have a Access 2000 data database containing only tables linked to a
>>Program
>> database. I need to alter the structure of one of the data tables. (Add
>> a
>> field.) I would like to do it from code in the Programs database.
>> ALTER
>> table does not work on linked tables.
>>
>> Is there any way to do this?
>>
>
>