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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help making a MS Access Database NOT version specific 1

Status
Not open for further replies.

Felix18807

Programmer
Jun 24, 2011
39
GB
Hi All,

I hope this post is okay I apologise if I've made any faux pas.

Basically I've made a small Access tool that adds some data to a spreadsheet after comparing it to an master table. It works fine on my machine (2010) but throws error messages relating to library references when I try to get it working on other peoples machines.

I have tried coding in library reference links into the form on load event but due to my lack of experience this did not seem to work.

I also tried packaging the tool with the Access 2010 runtime but this also failed.

The references used are -
Microsoft Office 14.0 Access database engine object library
MIcrosoft ActiveX Data Object 6.0 Library
Microsoft Office 14.0 Object library
Microsoft Visual Basic for Applications Extensibility 5.3
Microsoft Excel 14.0 Object library
Microsoft Word 14.0 Object library
Microsoft Internet controls

I have tried this -


On Error Resume Next
Dim i As Long
Dim theRef As Variant

For i = References.Count To 1 Step -1
Set theRef = References.Item(i)
If theRef.IsBroken = True Then
References.Remove theRef
End If
Next i

References.AddFromFile ("C:\PROGRA~1\COMMON~1\MICROS~1\VBA\VBA7\VBE7.DLL")
References.AddFromFile ("C:\program files\common files\microsoft shared\dao\dao360.dll")
References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\OFFICE14\ACEDAO.DLL")
References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\OFFICE14\MSO.DLL")
References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\vba\vba6\vbe6.dll")
References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB")
References.AddFromFile ("C:\Program Files\Common Files\Microsoft Shared\vba\vba7\vbe7.dll")
References.AddFromFile ("C:\Program Files\Common Files\System\ado\msado15.dll")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office12\acedao.dll")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office14\EXCEL.EXE")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office14\MSACC.OLB")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office14\MSWORD.OLB")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office12\EXCEL.EXE")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office12\MSACC.OLB")
References.AddFromFile ("C:\Program Files\Microsoft Office\Office12\MSWORD.OLB")
References.AddFromFile ("C:\Windows\system32\stdole2.tlb")
References.AddFromFile ("c:\windows\system32\ieframe.dll")

but this failed to stop the error.

Unfortunately I dont have access to a PC with an older version of access to fix the issue and I don't want to keep sending unworkable tools to my client.

Can anyone offer any help on this? (you'll have to be explicit I'm not to bright)

If necessary I will upload the tool.

Thanks in advance
 
I've never done this myself, but I remember it is a chapter in my favorite Access Book series...

Published by Sybex: Access <Version> Developer Handbook

I have the 97 and 2000 versions of those books, so it has been a while since I had my nose in them.

Also, from what I remember you want to add references by name not files so you can sort out the versioning issues.

I hope this helps. And those books are worth every penny if you are learning Access and a decent reference otherwise.
 
I've done some more research and there are some websites that have some information about supplying vba references. I'm just still having issues finding the solution to my specific setup. If anyone has any more info.

I will have to invest in these books which it seems are very inexpensive if you're happy to buy second hand.

Thanks for the heads up
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top