Bruno
Bruno

Reputation: 6449

MS Access changing reference path to a no longer existing path

When I compile a MS Access 2003 app on Windows 7 SP1 64bit and launch it in Windows 7 SP1 32bit the Microsoft Common Dialog Control 6.0 (SP3) path changes from C:\Windows\SysWOW64\comdlg32.ocx to \\shared\access\comdlg32.ocx which is the shared drive the app launches from for Windows 7 SP1 32bit users.

I need the reference on 32bit machines to be: C:\Windows\System32\comdlg32.ocx

The 32bit machine errorors out on : Dim Cnxn As ADODB.Connection Set Cnxn = New ADODB.Connection But when the Common Dialog Control is referenced correctly by downloading the app to the 32bit machine, browsing for the comdlg32 file, adding it as a reference, and recompiling, the app works fine on the 32bit pc.

What does the Common Dialog Control have to do with ADODB? I don't think I use the Microsoft Common Dialog Control anywhere. I will do more testing...

Upvotes: 0

Views: 1822

Answers (2)

Arnoud Kooi
Arnoud Kooi

Reputation: 1747

If u use it for a filedialog remove the reference and replace it with the solution in this article:

http://access.mvps.org/access/api/api0001.htm

EDIT: This should also work in newer version because it's just a way to get around using the comdlg32.ocx control.

You get the ADODB error because that is another reference, when the comdlg32.ocx fails to load Access exits the loop of loading the references, so the ADODB component isn't loaded.

Another option you could try is remove the reference and using late binding for example

Dim fDialog As Object ' previous Office.FileDialog
Set fDialog = CreateObject("Office.FileDialog")

Upvotes: 1

phoog
phoog

Reputation: 43046

The reference has nothing to do with ADODB.

The test to see if you are using it is simple: remove the reference. If the project fails to compile, then the reference was in use.

If you are not using the reference, remove it, and your problem is solved. If you are using the reference, you can replace its functionality with Windows API calls, as Arnoldiusss suggested.

Upvotes: 0

Related Questions