Best way to update field properties in backend of distributed app?

M

Max Moor

Hi All,

I have a 2002 app that's been out for some time. In the past, I've
only ever updated the front end, so it's been easy to release patches. Now I
want to release a patch that adds a couple of fields to a backend table and
changes some properties of existing fields. I'm wondering how folks "in the
know" handle this?

I don't want to replace the backend and try to move the data from the
old one to the new one. It seems more straight forward if I run backend
update code from the new front end. The code in the front end can tell if
the update has been done. If it hasn't, it will do the updates as needed.
Maybe I could keep a flag in the front end tracking if the uupdates have been
done, so I don't have to run the test code with every start of the app?

Does this sound sensical and doable? Is there a better way to do
backend updates? I appreciate any advice on the matter.

Regards,
Max
 
D

Dirk Goldgar

Max Moor said:
Hi All,

I have a 2002 app that's been out for some time. In the past, I've
only ever updated the front end, so it's been easy to release patches.
Now I
want to release a patch that adds a couple of fields to a backend table
and
changes some properties of existing fields. I'm wondering how folks "in
the
know" handle this?

I don't want to replace the backend and try to move the data from the
old one to the new one. It seems more straight forward if I run backend
update code from the new front end. The code in the front end can tell if
the update has been done. If it hasn't, it will do the updates as needed.
Maybe I could keep a flag in the front end tracking if the uupdates have
been
done, so I don't have to run the test code with every start of the app?

Does this sound sensical and doable? Is there a better way to do
backend updates? I appreciate any advice on the matter.


You can do this with DAO -- in fact, I've done it recently. For example
(air code):

Dim dbBE As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim strBackendPath As String

' Get the path to the back-end.
strBackendPath = fncBackendPath()

Set dbBE = Application.DBEngine.OpenDatabase(strBackendPath)

Set tdf = dbBE.TableDefs("TableToModify")

Set fld = tdf.CreateField("NewField", dbText, 50)
tdf.Fields.Append fld
fld.Properties.Append fld.CreateProperty("UnicodeCompression",
dbBoolean, True)

Set fld = Nothing
Set tdf = Nothing
dbBE.Close
Set dbBE = Nothing
 
M

Max Moor

(e-mail address removed):

You can do this with DAO -- in fact, I've done it recently. For example
(air code):

Dim dbBE As DAO.Database


Thanks, Dirk. It looks like this is the stuff I need. I'll go start
playing.

Regards,
Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top