Re: mdb field maintenance
- From: "Bill" <stanton@xxxxxxx>
- Date: Fri, 25 Nov 2005 18:51:32 GMT
Steve,
I think that what you've offered with your code is essentially
all I need to do the simple table-field additions. If the time
comes where more complex types of back-end updating
is required, I will heed Marshall's words of caution.
As an aside, I attempted to lookup "TableDef" in the A2K VBA
Help TOC. I get several matches but get no response when
I click on any of the related topics. I've made several attempts
in the past to answer why this occurs, including re-installing
O2K and re-applying the SR1 and SP2/SP3 updates. Do I
need to download VBA appendages or something like that?
Thanks,
Bill
"Steve Schapel" <schapel@xxxxxxxxxxx> wrote in message
news:%239Q2zre8FHA.1000@xxxxxxxxxxxxxxxxxxxxxxx
> Bill,
>
> Here is an example of code I have used recently for this purpose...
>
> Private Sub Form_Load()
> Dim strSQL As String
> Dim dbs As DAO.Database
> If FieldExists("SchoolDetails", "SMTPServer") Then
> ' do nothing
> Else
> Set dbs = OpenDatabase(fGetLinkPath("Courses") &
> "Matrices_be.mdb")
> strSQL = "ALTER TABLE SchoolDetails ADD COLUMN SMTPServer
> TEXT(50)"
> dbs.Execute strSQL, dbFailOnError
> Set dbs = Nothing
> End If
> End Sub
>
> Public Function FieldExists(strTable As String, strField As String) As
> Boolean
> Dim strName As String
> On Error GoTo fe_err
> strName = CurrentDb.TableDefs(strTable).Fields(strField).Name
> FieldExists = True
> Exit Function
> fe_err:
> If Err.Number = 3265 Then
> FieldExists = False
> Else
> MsgBox Err.Description
> End If
> End Function
>
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> Bill wrote:
>> Allen,
>> Thanks for your reply. Perhaps I wasn't quite as clear as
>> I had intended. Yes, the application updates usually pertain
>> to the front-end with the advent of enhancements to its
>> functionality and/or embellishments of some sort.... maybe
>> even the rare occurrence of a "bug-fix". :-)
>>
>> What I was trying to get at was when a change in the front-end
>> imposes a corresponding change in table(s) and/or table-fields
>> in the back-end, I need for the front-end application to quickly
>> check the back-end at startup to see if "one-time" utility code
>> needs to run to augment or otherwise apply a change to an
>> out-dated back-end mdb.
>>
>> I will read Toews' utility.
>>
>> Thanks again,
>>
>> Bill
.
- References:
- mdb field maintenance
- From: Bill
- Re: mdb field maintenance
- From: Allen Browne
- Re: mdb field maintenance
- From: Bill
- Re: mdb field maintenance
- From: Steve Schapel
- mdb field maintenance
- Prev by Date: Re: Timeline Control?
- Next by Date: Re: mdb field maintenance
- Previous by thread: Re: mdb field maintenance
- Next by thread: Re: mdb field maintenance
- Index(es):
Relevant Pages
|