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!

64 Bit adventure

Status
Not open for further replies.

vbajock

Programmer
Jun 8, 2001
1,921
US
I have a Access 2003 apps attempting to run on a new 64-bit Windows 7/Access 2010 box. The code refuses to compile API calls. According to various web sites, this is supposed to be the fix, but I can't get it to work. The 2010 box will not compile the code, it highlights the 32 bit call in the Else block and gripes about needing the code updated. Any help appreciated!

#If VBA7 Then

Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr

Else


Private DeclareFunction ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

End If
 
Lack of #, I guess:
#If VBA7 Then
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
[!]#[/!]Else
Private DeclareFunction ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
[!]#[/!]End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Still no go. "Compile error: the code in this project must be updated for 64 bit systems......"

Everything after the #ELSE is in red.

The hash marks were there, I just goofed on the cut and paste, but it sure got my hopes up/
 
Access was installed as a 64bit application, apparently you have the option to choose 64 or 32 on install, I am beginning to think that if you choose 64 bit this workaround will break.
 
Yep, that was it, uninstalled Office 2010 64 bit ver, installed Office 2010 32 bit version on a 64 bit operating system, everything works fine with no code changes on Office 2000 databases.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top