Re: mdb field maintenance

Tech-Archive recommends: Fix windows errors by optimizing your registry



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


.



Relevant Pages

  • RE: Error Trap not working
    ... "Steve C" wrote: ... Dim ColAAddress As String, ColAName As String, ColBRange as String ... 'Code here that names the range of cells in Col. B as ColBRange ...
    (microsoft.public.excel.programming)
  • Re: Speed up Program Process
    ... Bill ... maperalia wrote: ... >>>Dim fNameAndPath As String ...
    (microsoft.public.excel.programming)
  • Re: Speed up Program Process
    ... "Bill Martin" wrote: ... > maperalia wrote: ... >> Dim fNameAndPath As String ...
    (microsoft.public.excel.programming)
  • RE: Duplicating A Record with Null values
    ... Steve S ... Only strDeliverable5 is delcared as a String ... Dim Null_Deliverable2 As String ...
    (microsoft.public.access.forms)
  • Re: Find a String in VB.NET
    ... i gave a split method example too...look in this thread. ... op is trying to acheive...one being a delimited string search returning ... | "steve" schreef in bericht ... |> dim regExp as new regEx ...
    (microsoft.public.dotnet.languages.vb)