Link to home
Start Free TrialLog in
Avatar of Rob4077
Rob4077Flag for Australia

asked on

Declare Function DeleteUrlCacheEntry 64 bit system

I am using the following function in one of my databases that needs to run on both 32 bit and 64 bit systems. Two questions:
1)   Is there any way to modify it so it will run on both, or do I need different front ends for each version?
2)  What do I need to do to make it run on a 64 bit version of MS Access (2010)?

Private Declare Function DeleteUrlCacheEntry Lib "wininet" Alias _
    "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
ASKER CERTIFIED SOLUTION
Avatar of pdebaets
pdebaets
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob4077

ASKER

That appears to work on my 32 bit version at home. I will confirm it on the 64 bit version at the office tomorrow before I close the question. Thanks very much for your help
Your URLDownloadToFile function will return a LongPtr value in Access 2010. So you may need additional code changes such as

#if VBA7 then
dim ReturnVal as LongPtr
#Else
dim ReturnVal as Long
#end if

ReturnVal = URLDownloadToFile(...
Avatar of Rob4077

ASKER

Can I just change it to Single instead of LongPtr/Long ?
Avatar of Rob4077

ASKER

All works perfectly. Thanks.