Update backend with one more table?

J

Jen

I need to make an update/upgrade for my application. Have done this before
but this time the update is a bit different and I can't figure out how to do
it. I have to update the frontend as normally, but this time also the
backend. I need to be able to put a new table into the backend without
overwriting the ones that's allready there containing data and in use. To
clarify (I hope..):

Assume I have a backend with 3 tables allready in use and containing data. I
now need to make an installer that puts (imports?) a new table to the
backend, this also containing some data "from the beginning" so to speak.
The goal is to have a backend containing 4 tables instead of the three
allready there, without overwriting the three old ones in the process. If
possible this new table should also be set to hidden.

My applications built-in backup function simply copies the whole backend so
my clients can't use this built-in backup function in order to acchieve
this. If they uninstall, install the updated version (this way the backend
would be replaced) and restore the backup my backend ends up with 3 tables
again.

I have the Sagekey Access 2003 MSI Wizard and contacted them on this matter,
but the 3 months of free support is gone and they have not answered my
question.


I hope I make any sense, my mother tung is swedish, not english.
 
A

Arvin Meyer

You can do it with a query, from an installer database with a temporary
front-end table. Here's some of one I did several years ago:

Dim strPath As String
Dim strSQL As String

strPath = "C:\Path to back end.mdb"

strSQL = "SELECT tblAddresses.* INTO tblAddresses IN '" & strPath & "' FROM
tblAddresses"
CurrentDb.Execute strSQL
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
J

Jen

Hmm. That "Path to back end.mdb" is a problem. The installer let's the end
user to choose the installation directory so I don't know what it might be.
Also one cwould assume that most of the users has installed to the "Program
files" directory as the installer recommends, but some of the users hawe a
swedish Windows where that directory is called simply "Program" ( not
"Program files").
 
A

Arvin Meyer

To do this in code, you need to know where the back-end is. If you have
access to it, go into Design View, right-click on the Title Bar and choose
Properties. Look at the Connect property. Dev Ashish wrote some code a while
ado to do this programmatically:

Function GetLinkedDBName (TableName As String)
Dim db As Database, Ret
On Error GoTo DBNameErr
Set db = CurrentDb()
Ret = db.TableDefs(TableName).Connect
GetLinkedDBName = Right(Ret, Len(Ret) - (InStr (1, Ret,
"DATABASE=") + 8))
Exit Function
DBNameErr:
GetLinkedDBName = 0
End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Top