UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Access On 64bit System, Access 2016    
 
   
pere_de_chipstic...
post Jun 11 2019, 09:26 AM
Post#1


UtterAccess Editor
Posts: 10,433
Joined: 8-November 07
From: South coast, England


Hi All

One of my clients has updated all of his PCs (c. 30) to run 64 bit office, which means I need to update the database he uses to run both 32 and 64 bit.

I have some 26 Declare Functions / subs which I have modified with 'ptrSafe' and 'LongPtr' as appropriate (I think wary.gif ), which while working on my (32 bit) office computer I've not tested on a 64 bit system yet.

Are there any web sites where I can check I've amended each declare function correctly and are there any other issues that I might need to look out for in the rest of my code?

Thanks

--------------------
Warm regards
Bernie
Go to the top of the page
 
DanielPineault
post Jun 11 2019, 09:31 AM
Post#2


UtterAccess VIP
Posts: 6,641
Joined: 30-June 11



Everything you need can be found by downloading https://www.microsoft.com/en-us/download/de...ls.aspx?id=9970 (don't worry about the 2010, it still fully applies, 64-bit is 64-bit!)

--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
gemmathehusky
post Jun 11 2019, 10:11 AM
Post#3


UtterAccess VIP
Posts: 4,674
Joined: 5-June 07
From: UK


Can't you get him to go back to 32bit, Bernie?

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
pere_de_chipstic...
post Jun 11 2019, 10:17 AM
Post#4


UtterAccess Editor
Posts: 10,433
Joined: 8-November 07
From: South coast, England


Hi Daniel

That's a great start - thank you.

I still have a few issues e.g. I have:
CODE
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias _
            "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) _
            As Long


Which doesn't seem to have an equivalent in the download files.

I'll continue working through the list and see if I can resolve any other issues that may come to light.

BTW, My client seems to be under the impression that 32bit will be made obsolete as 64k is now the default installation. Is this the case? and is there any other reason for moving to 64bit apart from the extension to number sizes (e.g. in Excel) and address range extension?

Cheers


--------------------
Warm regards
Bernie
Go to the top of the page
 
pere_de_chipstic...
post Jun 11 2019, 10:18 AM
Post#5


UtterAccess Editor
Posts: 10,433
Joined: 8-November 07
From: South coast, England


Hi Dave

Wish I could, but my client isn't too keen on the idea I have to say.

--------------------
Warm regards
Bernie
Go to the top of the page
 
isladogs
post Jun 11 2019, 10:20 AM
Post#6


UtterAccess VIP
Posts: 1,413
Joined: 4-June 18
From: Somerset, UK


Just in case, I would use conditional compilation so it runs in both 32-bit and 64-bit.
Of course if you distribute ACCDE files that means releasing a version in each bigness.

Phillip Stiefel has also written an excellent reference. See https://codekabinett.com/rdumps.php?Lang=2&...tion-vba-64-bit

--------------------
Go to the top of the page
 
pere_de_chipstic...
post Jun 11 2019, 10:35 AM
Post#7


UtterAccess Editor
Posts: 10,433
Joined: 8-November 07
From: South coast, England


Hi Colin,

Thank you for the link, that looks very useful.

I was hoping to use conditional compilation as you suggest, but will need two systems (one running 32 and the other 64 bit) to create the appropriate accde files for each version!

Cheers

--------------------
Warm regards
Bernie
Go to the top of the page
 
DanielPineault
post Jun 11 2019, 11:17 AM
Post#8


UtterAccess VIP
Posts: 6,641
Joined: 30-June 11



If you plan on supporting 32 and 64 bit using the same db, review http://www.devhut.net/2017/04/13/access-x3...-compatibility/

CODE
Private Declare PtrSafe Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As LongPtr


The bigger issue is that certain ActiveX components do not have equivalent 64-bit versions. So if you build tools using ActiveX Control, beware of switching. In my experience, there has been no real advantage to switching for my clients. I have one who utilizes bigger Excel Workbooks, but for me this is more indicative that they should be using a different tool for the job meant to house that quality of data. But for the average business or home user, there is no point whatsoever.

--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
isladogs
post Jun 11 2019, 11:27 AM
Post#9


UtterAccess VIP
Posts: 1,413
Joined: 4-June 18
From: Somerset, UK


True but you really need two systems to check functionality anyway.
An easy way of doing that if you don't already have both is to put the 64-bit version on a VM.

NOTE: Even if code compiles in 64-bit, that doesn't necessarily mean it will function as intended if you get any of the LongPtr declarations wrong.
Another very useful tool is the Windows API Viewer utility on Ron de Bruin's website.

Whilst I agree with Daniel's point about there being no benefits in 64-bit Access and many disadvantages, the fact remains that an increasing number of people are now installing 64-bit. As that is now the default installation for Office 365, the rate of uptake is likely to accelerate.

--------------------
Go to the top of the page
 
DanielPineault
post Jun 11 2019, 11:36 AM
Post#10


UtterAccess VIP
Posts: 6,641
Joined: 30-June 11



No argument there. Microsoft has made the choice to basically throw people into 64-bit without there true knowledge (no option at installation and they have no clue it defaults to 64-bit), so yes, its adoption has, and will, continue to grow substantially now.

--------------------
Daniel Pineault (2010-2018 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
ADezii
post Jun 11 2019, 12:17 PM
Post#11



Posts: 2,372
Joined: 4-February 07
From: USA, Florida, Delray Beach


I am not sure if this is the same Reference referred to by Daniel, but I have found it very useful.
This post has been edited by ADezii: Jun 11 2019, 12:18 PM
Attached File(s)
Attached File  64_Bit_API_Declarations_With_PrtSafe.zip ( 317.9K )Number of downloads: 7
 
Go to the top of the page
 
PhilS
post Jun 12 2019, 02:54 AM
Post#12



Posts: 573
Joined: 26-May 15
From: The middle of Germany


QUOTE
.... is there any other reason for moving to 64bit apart from the extension to number sizes (e.g. in Excel) and address range extension?

There are a couple of memory issues (e.g. with the number of open forms) that will happen a lot less with the 64Bit edition of Access.

--------------------
Go to the top of the page
 
pere_de_chipstic...
post Jun 12 2019, 01:51 PM
Post#13


UtterAccess Editor
Posts: 10,433
Joined: 8-November 07
From: South coast, England


Thanks all for your help and guidance - much appreciated.

I've updated my db and it tests out on my 32bit system though I have still to try it out on a 64 bit system - I'll update this thread if anything else comes to light when I do.

WIN32API_ptrSafe.txt was particularly useful.

Some issues I found that may help anyone reading this in the future
1. It's not as simple as adding ptrSafe and "As LongPtr" to the API declaration
a number of 64bit API functions still return a value as 'Long' not as 'LongPtr'

2. Some 'internal' parameters of a number of API also need to be changed from Long to LongPtr
Copying the declare function from WIN32API_ptrSafe.txt is probably the easiest way update your declarations

3. You also need to check the code that calls the 64 bit APIs
'Long' handles and pointers passed to the API need to be changed to LongPtr

4. If the lengths of pointers are called up using Len({String})
These need to be changed to LenB({String})
eg, in the OPENFILENAME API you need to change openfile.lStructSize = Len(openfile) to openfile.lStructSize = LenB(openfile)

5. I did have a couple of API calls that didn't appear to be referenced in WIN32API_ptrSafe.txt
I've deleted these and replaced the function with (in this case) a folder dialog Application.FileDialog(msoFileDialogFolderPicker), which seems an easier way of doing it anyway!

6. Also you need to check the Type declarations as these can be different as well!

Hope that helps anyone else coming along, and thanks all for your help uarulez2.gif yayhandclap.gif

This post has been edited by pere_de_chipstick: Jun 12 2019, 02:11 PM
Reason for edit: Added point 6.

--------------------
Warm regards
Bernie
Go to the top of the page
 
ADezii
post Jun 12 2019, 02:20 PM
Post#14



Posts: 2,372
Joined: 4-February 07
From: USA, Florida, Delray Beach


How could you possibly forget the LongLong Data Type for 64-bit Systems? laugh.gif
This post has been edited by ADezii: Jun 12 2019, 02:21 PM
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    17th June 2019 - 08:10 PM