Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

References Files

Status
Not open for further replies.

DH

Programmer
Dec 8, 2000
168
My application does not function correctly when installing on a XP machine. I receive the #NAME error in fields when my applicaton uses functions like UCASE, etc. The application also generates a runtime error when using DMAX to determine the highest ID number in a table.

I am using the following reference files in my Access 2K application and am wondering if the issue is here.

Visual Basic For Application
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft Access 9.0 Object Library
Microsoft DAO 3.6 Object Library
Microsoft Calendar Control 9.0
OLE Automation
Microsoft Windows Common Controls-2 6.0 (SP4)
Microsoft Windows Common Controls6.0 (SP4)
Microsoft Forms 2.0 Object Library
Microsoft Office 9.0 Object Library
Microsoft Outlook 9.0 Object Library
Microsoft Word 8.0 Object Library

Is there a resource somewhere that explains each of these references and the files/file versions associated with them?

If I 1.) install my applicaion using the package and deployement wizard with runtime, I get the errors, so I then 2.)install full version of access, 3.) remove the Microsoft Visual Basic for Applications Extensibility 5.3 reference, compile, add the Microsoft Visual Basic for Applications Extensibility 5.3 reference again, compile, then everything seems to run okay.

Do you have any suggestions?

Thanks,
DH

 
My experience has been that when something odd like you have described above starts to happen there is usually a broken reference somewhere in the list. If you open up the list in the Tools menu it will show missing.

A frequent culprit for things using Office components is a new/older dll version (eg Access 9.0 Object library versus Access 10.0 Object library, etc). One way around this is to use late binding for those types of dlls.

For example, don't check the Access x.x Object library at all. Then in your code do something like the following:

Dim objAccessObject As Object 'instead of Access.Application

Set objAccessObject = CreateObject("Access.Application")

That way standard functionality will be available to you regardless of which version they are using. You will lose intellisense when you do this, so you may want to leave it in until most of your development is done and then change it. I'm not sure how to use the above technique with DAO, etc.

You can also spin through the references collection checking the various properties to see whether any are missing, etc.

Good LucK!

Have a great day!

j2consulting@yahoo.com
 
The first thing I did was check to see if any references were missing and they are all intact.

As you mentioned I am also thinking the problem is some sort of dll version issue. I'll try what you suggested.

DH
 
One thing--check the references on the BROKEN machine. When I first tackled this issue, I'd go over to the user's computer, verify it didn't work, go back to my machine, figure out it was a references issue (probably by reading tek-tips), check the references, and find nothing wrong. You have to check the references on their machine.

Maybe it's obvious to you, but it wasn't obvious to me...the first few times.
 
I have checked the references on the users machine. There are no missing references.

It must be a .dll version issue of some type?

Any other suggestions?

DH
 
I have no idea if this will help, but if you don't have to many to change, try using late binding for all of your explcit Office objects:

Microsoft Access 9.0 Object Library
Microsoft Outlook 9.0 Object Library
Microsoft Word 8.0 Object Library

Once you have converted them to late binding, uncheck them from your references list and see if that helps.

Based on everything you have said, I think you are correct in thinking there is a dll problem somewhere. Sorry I can't be more helpful.

Good Luck!

Have a great day!

j2consulting@yahoo.com
 
I'll try the late binding and see if that corrects the problem.

I have also pulled out the Access 2000 Developers Handbook to research further.

Thanks...
DH
 
Does anyone have a code example to unload and then reload the reference files on startup? This seems to work when I do it manually.

Thanks,
DH
 
Hi!

Saw this thread705-730665 a couple of days ago. Might it be someting you could apply?

Else, there are lots of threads containing reference issues, a keyword search might also provide something.

Roy-Vidar
 
Hello DH,

Hopefully this will at least get you started. It lists the various dll properties to the immediate window and shows you how to reference the References collection.

Option Compare Database
Option Explicit
'
'Spin through the Application References collection
Public Function GetReferences() As String
Dim refItem As Reference
Dim objAccess As Object
Dim refItems As Access.References
Dim strDatabase As String
Dim strStatus As String
Dim strReferences As String
Dim strPath As String
Dim strName As String
Dim strBroken As String
Dim strBuiltIn As String

On Error GoTo Err_GetReferences

strDatabase = Application.DBEngine.Workspaces(0).Databases(0).Name

Debug.Print "BuiltIn", "Broken", "Name", "Status", "Maj", "Min"
For Each refItem In Application.References
With refItem
If .BuiltIn Then
strBuiltIn = "Yes"
Else
strBuiltIn = "No"
End If
strStatus = "OK"
'Check the Name
If IsError(.Name) Then
strStatus = "BAD"
strName = vbNullString
Else
strName = .Name
End If
'Check the Full Path
If IsError(.FullPath) Then
strStatus = "BAD"
strPath = vbNullString
Else
strPath = .FullPath
End If
'Check if it is broken
If .IsBroken Then
strStatus = "BAD"
strBroken = "YES"
Else
strBroken = "No"
End If
Debug.Print .BuiltIn, strBroken, strName, strStatus, .Major, .Minor
Debug.Print vbTab; "Path: " & strPath
Debug.Print vbTab; "GUID: " & .GUID
Debug.Print
End With
Next refItem

GetReferences = strReferences

Exit_GetReferences:
Exit Function

Err_GetReferences:
Select Case Err.Number
Case 432 'File name or class name not found during Automation operation
Resume Exit_GetReferences
Case Else
MsgBox "Error: " & Err & " - " & Err.Description
Resume Exit_GetReferences
End Select
End Function 'GetReferences

Have a great day!

j2consulting@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top