PDA

View Full Version : References (Program files vs Program files X86)



Movian
02-23-2012, 09:38 AM
Hey,
I am having some problems with references (aparently after a windows update on our development server). All the references in our base DB have switched their DLL location from C:\Program Files\Common Files to C:\Program Files(x86)\Common Files.

This of course means that we can no longer distribute the system to 32 bit machines as the location does not exist. When i try and force the references to change to the correct location they simply use the same one....

and some reference like Microsoft Access 12.0 Object library can't be un selected to change it in the first place!

I would rather not have to save a copy out of source control as a .adp then transfer it to a 32 bit virtual machine. Adjust all references, then compile to an accde EVERY TIME!

is there any way i can fix this so i can just create a .accde directly from our Dev Server again ?

Tommy
02-23-2012, 11:29 AM
Hi Movian,

There are some api's that deal with that special directory, I am not sure if it will benifit you but it is worth a shot :)


Const CSIDL_DESKTOP = &H0
Const CSIDL_PROGRAMS = &H2
Const CSIDL_CONTROLS = &H3
Const CSIDL_PRINTERS = &H4
Const CSIDL_PERSONAL = &H5
Const CSIDL_FAVORITES = &H6
Const CSIDL_STARTUP = &H7
Const CSIDL_RECENT = &H8
Const CSIDL_SENDTO = &H9
Const CSIDL_BITBUCKET = &HA
Const CSIDL_STARTMENU = &HB
Const CSIDL_DESKTOPDIRECTORY = &H10
Const CSIDL_DRIVES = &H11
Const CSIDL_NETWORK = &H12
Const CSIDL_NETHOOD = &H13
Const CSIDL_FONTS = &H14
Const CSIDL_TEMPLATES = &H15
Const MAX_PATH = 260
Private Type SHLTEMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As SHLTEMID
End Type
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Show an about window
ShellAbout Me.hWnd, App.Title, "Created by the KPD-Team 1999", ByVal 0&
'Set the graphical mode to persistent
Me.AutoRedraw = True
'Print the folders to the form
Me.Print "Start menu folder: " + GetSpecialfolder(CSIDL_STARTMENU)
Me.Print "Favorites folder: " + GetSpecialfolder(CSIDL_FAVORITES)
Me.Print "Programs folder: " + GetSpecialfolder(CSIDL_PROGRAMS)
Me.Print "Desktop folder: " + GetSpecialfolder(CSIDL_DESKTOP)
End Sub
Private Function GetSpecialfolder(CSIDL As Long) As String
Dim r As Long
Dim IDL As ITEMIDLIST
'Get the special folder
r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
If r = NOERROR Then
'Create a buffer
Path$ = Space$(512)
'Get the path from the IDList
r = SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal Path$)
'Remove the unnecessary chr$(0)'s
GetSpecialfolder = Left$(Path, InStr(Path, Chr$(0)) - 1)
Exit Function
End If
GetSpecialfolder = ""
End Function

Movian
02-23-2012, 12:09 PM
Well those are for getting the path to those folders,

Im refering to the paths specificaly to the references. for Microaoft Active Data Objects 2.8
Microsoft DAO
etc etc