473,545 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange behavior with Dev Ashish's fRefreshLinks function (from Access Web)

Hi all,

(WinXP Pro SP2, Access 2003)

I'm using Dev Ashish's fRefreshLinks function from AccessWeb
(http://www.mvps.org/access/tables/tbl0009.htm) to relink tables in my
front end to one of several back end files.

When I first dropped in the function I was getting an error on one of
my tables saying "Couldn't relink table, table doesn't exist"... or
something similar, for one of my tables. Of course, this wasn't the
case, the table exists, and in fact could be relinked using the Linked
Table Manager in Access. After a few hours of confusion, I deleted the
linked table, reimported it, then reran Dev Ashish's code. This worked,
and the function, continues to work at this time.

My question: any thoughts on why this happened and what can be done to
prevent it in the future.

Within the fRefreshLinks function, this is where the error originates:

If fIsRemoteTable( dbLink, strTbl) Then
'everything's ok, reconnect
Set tdfLocal = dbCurr.TableDef s(strTbl)
With tdfLocal
.Connect = ";Database= " & strDBPath
.RefreshLink
collTbls.Remove (.Name)
End With
Else
Err.Raise cERR_NOREMOTETA BLE
End If
End If

fIsRemoteTable( dbLink, strTbl) takes you to the following:

Function fIsRemoteTable( dbRemote As Database, strTbl As String) As
Boolean
Dim tdf As TableDef
On Error Resume Next
Set tdf = dbRemote.TableD efs(strTbl)
fIsRemoteTable = (Err = 0)
Set tdf = Nothing
End Function

Which returns False, thus putting you back into Err.Raise
cERR_NOREMOTETA BLE, and thusly the error.

Now to be perfectly clear, I don't completely understand all of the
code in the functions, although I have the Access 2002 Developer's
Handbook and I'm attempting to figure it all out :D.

Anyhow, any thoughts would be greatly appreciated on why this happened
and how to prevent it from happening in the future would be
appreciated.

Best,

Kelii

Jan 26 '07 #1
4 3782
Kelii, is this a secured database (i.e. permissions controlled by an MDW)?
If so, the message may mean that the user did not have permission to set the
properties.

It could also fail if there were a deleted linked table.
You could avoid that with:
With tdfLocal
If Not tdfLocal.Name Like "~*" Then
.Connect = ";Database= " & strDBPath
.RefreshLink
collTbls.Remove (.Name)
End If
End With

Acess 2000 and later cache much more information about the linked tables
than used to be the case when Dev first wrote that. There are cases where
the cached info can cause problems. You could probably avoid those problems
(and the deleted table issue above) by compacing the database, and then
trying to link again.

The cached table info can even cause problems after a successful relink.
Compacting after the relink also can avoid those problems.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Kelii" <ke****@yahoo.c omwrote in message
news:11******** **************@ q2g2000cwa.goog legroups.com...
Hi all,

(WinXP Pro SP2, Access 2003)

I'm using Dev Ashish's fRefreshLinks function from AccessWeb
(http://www.mvps.org/access/tables/tbl0009.htm) to relink tables in my
front end to one of several back end files.

When I first dropped in the function I was getting an error on one of
my tables saying "Couldn't relink table, table doesn't exist"... or
something similar, for one of my tables. Of course, this wasn't the
case, the table exists, and in fact could be relinked using the Linked
Table Manager in Access. After a few hours of confusion, I deleted the
linked table, reimported it, then reran Dev Ashish's code. This worked,
and the function, continues to work at this time.

My question: any thoughts on why this happened and what can be done to
prevent it in the future.

Within the fRefreshLinks function, this is where the error originates:

If fIsRemoteTable( dbLink, strTbl) Then
'everything's ok, reconnect
Set tdfLocal = dbCurr.TableDef s(strTbl)
With tdfLocal
.Connect = ";Database= " & strDBPath
.RefreshLink
collTbls.Remove (.Name)
End With
Else
Err.Raise cERR_NOREMOTETA BLE
End If
End If

fIsRemoteTable( dbLink, strTbl) takes you to the following:

Function fIsRemoteTable( dbRemote As Database, strTbl As String) As
Boolean
Dim tdf As TableDef
On Error Resume Next
Set tdf = dbRemote.TableD efs(strTbl)
fIsRemoteTable = (Err = 0)
Set tdf = Nothing
End Function

Which returns False, thus putting you back into Err.Raise
cERR_NOREMOTETA BLE, and thusly the error.

Now to be perfectly clear, I don't completely understand all of the
code in the functions, although I have the Access 2002 Developer's
Handbook and I'm attempting to figure it all out :D.

Anyhow, any thoughts would be greatly appreciated on why this happened
and how to prevent it from happening in the future would be
appreciated.

Best,

Kelii
Jan 27 '07 #2

Allen,

Thanks for the reply.

The database isn't secured at all, so permissions shouldn't be an
issue.

As far as the deleted table is concerned, that's a great add to the
code, I'll definately use it.

So, the problem must be the cached info as you suggest. I did not try
compacting the database back end / front end; in fact I did very little
other than stare at my laptop in bewilderment and randomly flip through
my Access library. Next time, I'll do as you suggest, compact the files
and see if that works.

Again, thanks for the reply; and btw, I use your MVP site frequently,
you've provided a great service to Access novices such as myself.

Kelii

Jan 27 '07 #3
"Allen Browne" <Al*********@Se eSig.Invalidwro te in
news:45******** *************** @per-qv1-newsreader-01.iinet.net.au :
Acess 2000 and later cache much more information about the linked
tables than used to be the case when Dev first wrote that. There
are cases where the cached info can cause problems. You could
probably avoid those problems (and the deleted table issue above)
by compacing the database, and then trying to link again.

The cached table info can even cause problems after a successful
relink. Compacting after the relink also can avoid those problems.
And sometimes the links have to be completely deleted and recreated
to get rid of certain types of cached data that cause extreme
performance degradation.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 27 '07 #4
"Kelii" <ke****@yahoo.c omwrote in
news:11******** **************@ q2g2000cwa.goog legroups.com:

[To Allen Browne:]
Again, thanks for the reply; and btw, I use your MVP site
frequently, you've provided a great service to Access novices such
as myself.
Not just to novices, Keri -- I use Allen's site almost daily and I
do this for a living and have been doing so for 10+ years.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5890
by: Ben | last post by:
I have written a procedure which calls the CORREL function of Excel to run correlation analysis on two arrays, then populate a table with the resulting correlation coefficient. This process loops through several records and recordsets. The procedure works well for awhile (sometimes upwards of 10,000 times!), but then mysteriously begins...
3
3471
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or less would display, but those close to 300 pixels/inch or greater would not (MS Access cannot recognize the file format xxx.jpg). The larger, original...
0
1121
by: Glorie | last post by:
Hi all, I use the function fRefreshLinks fro http://www.mvps.org/access/tables/tbl0009.htm to relink access tables from code. I get this error: Error in refreshing links Table tblTeamMS Access was not found in the database.
4
1875
by: Lauren Wilson | last post by:
Hi folks, I copied Dev Ashish's code below to a module in Access 2K. No mater what I do, Access will not recognize the function. What have I overlooked? I know I'm going to feel like an idiot when I hear the answer. All responses appreciated.
8
1989
by: David | last post by:
This is something I had never seen before. On an aspx page, upon pressing a link button for which I have an event handler in the code behind, the screen shows nothing but a line that says "true" up in the right upper corner of the browser. I have an XP and had just installed XP Service Pack II...against my better judgment. Please help. ...
0
1445
by: L Scott | last post by:
Have developed a c# / asp.net web app. Works locally. But over the internet when I access the site, it eventually returns a 'The page cannot be displayed' page. Not always on the same page. Can *eventually* re-display this error page correctly. Have not see this when I access the site locally (from desktop). Many of the pages have...
6
1688
by: Gary | last post by:
I have an application that has been working just fine for a couple of years. It queries a SQL database and returns some formatted data back to the client. I have a new client, who has a larger database than any of our previous customers. For example, the query to build the datatable now takes about 2 minutes instead of one minute or less....
7
4603
by: Tim_Mac | last post by:
hi, using .net 2.0, i have a web form with lots of textboxes, drop-down-lists etc. There are lots of required field validators and regular expression validators. When i click the 'save' button, the client-side validation is executed immediately and the errors flash up on screen. However at the same time, a post-back is performed and the...
160
5756
by: DiAvOl | last post by:
Hello everyone, Please take a look at the following code: #include <stdio.h> typedef struct person { char name; int age; } Person;
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3466
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
722
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.