FE/BE refresh links problem

  • Thread starter darren via AccessMonster.com
  • Start date
D

darren via AccessMonster.com

I have a split database which uses an FE updater. Because this used by
different teams each with their own BE, when a new version is released one of
the first things it does it set up the links to the relevant BE.This 'path'
is passed to it using cmd in the ini file.

However, I am finding that this code hangs if somebody is already in the
system (and therefore the BE). Code is as follows:

Dim db As Database
Dim tbl As TableDef
Dim rst As Recordset

p_strBEpath = Command()

DoCmd.Hourglass True
Set db = CurrentDb
Set rst = db.OpenRecordset("UsysLinkedTbls", dbReadOnly)

rst.MoveLast
rst.MoveFirst

Do Until rst.EOF
'Debug.Print rst("Name").value
Set tbl = db.TableDefs(rst("Name"))

If tbl.Connect <> p_strBEpath Then
With tbl
.Connect = p_strBEpath
.RefreshLink
End With
End If
rst.MoveNext

Loop
DoCmd.Hourglass False

Any suggestions as to how I can remedy this? On another thread some one
suggested just setting a new link instead of refreshing.Presumably I just
drop the .RefreshLink but if I do that will the link still be set up?

Thanks in advance.
 
D

darren via AccessMonster.com

In answer to my own question, I tried dropping the .RefreshLink and this did
not work. Even tried forcing the user to restart afterwards (assumed that the
new connection would then take effect), but this did not work either.

Any ideas?
 
J

John Nurick

I've been keeping quiet because I've never heard of UsysLinkedTbls,
can't find any reference to it and don't want to expose my ignorance. It
didn't help that you don't mention at what stage the code hangs (what
line of code, the first or the last table being refreshed, etc.)

But I've never had any problems with code based on that at
http://www.mvps.org/access/tables/tbl0009.htm and/or
http://www.mvps.org/access/tables/tbl0012.htm, or from the Access
Developer's Handbook.
 

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