Error: Function isn't available - Relink library references through VBA? (1 Viewer)

ForcedToUseIt

Registered User.
Local time
Today, 14:10
Joined
Jul 25, 2004
Messages
34
Hi all,

I had this problem happen to some of my users when I released my front end .mdb to about 50 users which meant that i had to go to them and relink the references manually on about 15 computers! :eek:
I found this article in the MSDN knowledge base and tried the code to fixit, but it didnt work since it is for Access 97 and I'm using Access 2003 with a .mdb file with Access 2000 file format as the default.

Can anyone tell me how it is best to resolve this problem? Perhaps the code in the article only needs some small adjustments to work or something. The stange thing is that it runs fine but doesnt fix the problem.
I have a feeling that it is the Call command at the bottom of the code that is not doing it's job...

Here is the code for your viewing:

Code:
Function CheckRefs()
   Dim db As Database, rs As Recordset
   Dim x
   Set db = CurrentDb

   On Error Resume Next

   ' Run the query qryTestRefs you created and trap for an error.
   Set rs = db.OpenRecordset("qryTestRefs", dbOpenDynaset)

   ' The if statement below checks for error 3075. If it encounters the
   ' error, it informs the user that it needs to fix the application.
   ' Error 3075 is the following:
   ' "Function isn't available in expressions in query expression..."

   ' Note: This function only checks for the error 3075. If you want it to
   ' check for other errors, you can modify the If statement. To have
   ' it check for any error, you can change it to the following:
   ' If Err.Number <> 0

    If Err.Number = 3075 Then
      MsgBox "This application has detected newer versions " _
             & "of required files on your computer. " _
             & "It may take several minutes to recompile " _
             & "this application."
      Err.Clear
      FixUpRefs
   End If


End Function

Sub FixUpRefs()
    Dim loRef As Access.Reference
    Dim intCount As Integer
    Dim intX As Integer
    Dim blnBroke As Boolean
    Dim strPath As String

    On Error Resume Next

    'Count the number of references in the database
    intCount = Access.References.Count

    'Loop through each reference in the database
    'and determine if the reference is broken.
    'If it is broken, remove the Reference and add it back.
    For intX = intCount To 1 Step -1
      Set loRef = Access.References(intX)
      With loRef
        blnBroke = .IsBroken
        If blnBroke = True Or Err <> 0 Then
          strPath = .FullPath
          With Access.References
            .Remove loRef
            .AddFromFile strPath
          End With
        End If
       End With
    Next

  Set loRef = Nothing

  ' Call a hidden SysCmd to automatically compile/save all modules.
  Call SysCmd(504, 16483)
End Sub
 

FoFa

Registered User.
Local time
Today, 09:10
Joined
Jan 29, 2003
Messages
3,672
Could it be they have an older version of the library so it is not finding it?
 

ForcedToUseIt

Registered User.
Local time
Today, 14:10
Joined
Jul 25, 2004
Messages
34
My developement computer has Access 2003 sp1 on it but some of my users have Access 2003 without the service pack. This might be the source of the problem but I would still be able to release my application without having to rely on the users to use the exact same version of access as i do.
The above code seems to do that for access 97, but what I would like is an access 2003 version of that code (the app is written in access 2000 format). I am sure that someone has solved this problem before and i see no reason to reinvent the wheel again ;)

So if anyone knows of a solution for this problem, please post it or a link to a similar solution if you know of any.
 

MaliciousMike

Registered User.
Local time
Today, 15:10
Joined
May 24, 2006
Messages
118
I'm having the same problem. But my references are because of the file location of Microsoft Office.
I'm using 2003 (Version 11, thus .../office11/excel.exe), and a lot of my users are using 2002 or lower (Version 10, thus .../office10/excel.exe).

It's rather annoying having to spend about an hour of my working day everytime i release a new version, which is frequent.
 

MeeMee

New member
Local time
Today, 07:10
Joined
Sep 2, 2009
Messages
1
I have the same exact problem and the code didn't work on access 2003 , did you find a way to solve this , please help anyone :(
 

Users who are viewing this thread

Top Bottom