Correct. I didn't say anything else.you can just use the About button to see the Bitness of your office, without using any VBA.
Correct. I didn't say anything else.you can just use the About button to see the Bitness of your office, without using any VBA.
No, not much. It also seemed that not all procedures using APIs declarations are used at all. And some could be replaced by other techniques, but I just corrected the API declarations.@AHeyne
Thanks for converting the APIs. Were many changes needed in Type statements and variable declarations in procedures?
I didn't know that, sorry. I just downloaded your accdb, corrected and uploaded it. You could export both versions to text files (as you mentioned GitHub you seem to know how this can be done) and compare the text files. It's not much work. Then you can correct the text files on GitHub by hand.Thanks but...
I need such changes to be in my db out on GitHub.
LOL. No, I don't know github. I use it only as a place to get the file off of my computer and publicly available to anyone who wants it. If you do understand such things how would one compare two access databases and get anything useful out of the comparison. These are databases (binary blobs of data) not text files.I didn't know that, sorry. I just downloaded your accdb, corrected and uploaded it. You could export both versions to text files (as you mentioned GitHub you seem to know how this can be done) and compare the text files. It's not much work. Then you can correct the text files on GitHub by hand.
I prefer to use Diffinity (http://truehumandesign.se/s_diffinity.php), which can compare files and folders.
Edit:
Ok, after reading all you postings it seems to have been done already. ;-)
I know how to export classes, forms and modules. However there are things such as queries, tables, data in tables, properties of things etc. NCAA how to do this globally. And I don't have a tool (yet) to automate exporting the things that make sense and getting them back in.I didn't know that, sorry. I just downloaded your accdb, corrected and uploaded it. You could export both versions to text files (as you mentioned GitHub you seem to know how this can be done) and compare the text files. It's not much work. Then you can correct the text files on GitHub by hand.
I prefer to use Diffinity (http://truehumandesign.se/s_diffinity.php), which can compare files and folders.
Edit:
Ok, after reading all you postings it seems to have been done already. ;-)
I was scrolling down to post a link for Adam's presentation. I have started using this Version Control Add-in. And I believe that he's working on a better GitHub integration for it.@jwcolby54 : I use my one solution (which isn't so well integrated yet), but here you can watch a presentation of a widely used Access add-in by Adam Waller:
I am retired. I am trying to write a book evangelizing the use of classes, events and frameworks. I know that well and I feel that there is no real solid documentation for teaching that to devs who don't use classes or frameworks. I am trying to create that. Solid documentation on this stuff. That is my sole reason for even being on this forum. A VM with 64 bit Access / demodb etc is almost certainly not in my future.Adam will also leading a presentation for Access Europe User Group in September where his focus will be on how source code control can also be very useful for sole developers
My reason for suggesting a 64-bit VM is to give you time so you can convert all your code to work in both 64-bit and 32-bit.
Once you have done each database, continue development in 64-bit ONLY. It will still work in 32-bit.
When all are done, swop so your main development machine is 64-bit.
I imagine the issue is that the 64 bit is now the default, and not many people need to deal with the differences.I would say you are putting off potential readers by being 32-bit only - not just me!
The proportion of developers using 64-bit is increasing all the time and surveys at Access DevCon etc suggest its now probably the majority.
Whilst those who need it may be willing to do the conversion themselves, there are a lot of classes to check!
There are many articles about converting to 64-bit, though many make it unduly complicated (or are incorrect)
The process is fairly easy but can be time consuming.
It really needs someone who knows the code so they can check it is working correctly in 64-bit
I have a series of 5 articles on the subject starting with:
![]()
32 to 64-bit Conversion
This article provides links to various web pages & utilities to assist with converting VBA code for use in 64-bit applications.www.isladogs.co.uk
My advice is to ignore A2007 and earlier in which case you don't need conditional compilation - see article 2 in that series
You could try to do without any bitness-specific code in your examples.I am retired. I am trying to write a book evangelizing the use of classes, events and frameworks. I know that well and I feel that there is no real solid documentation for teaching that to devs who don't use classes or frameworks. I am trying to create that. Solid documentation on this stuff. That is my sole reason for even being on this forum. A VM with 64 bit Access / demodb etc is almost certainly not in my future.
Public Function WinMachineName() As String
WinMachineName = Environ("COMPUTERNAME")
End Function
Function WinUsername()
WinUsername = Environ("USERNAME")
End Function
Private Declare PtrSafe Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, ByRef nSize As Long) As Long
Private Declare PtrSafe Function GetWinUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
John is definitely "All Gas, No Brakes"...Sorry. I meant that if John stopped changing his DB for a day or so...
There is very little bitness specific anyway. AFAI remember only the timer classes do calls to the OS. It is not I pushing the bitness thing, I don't really care as I don't (can't) use 64 bit anyway.You could try to do without any bitness-specific code in your examples.
It is not needed for the pure teaching of class programming anyway.
I believe the bitness changes got implemented and are now in the version up on GitHub. I donwloaded the changed version and pushed that up to GitHub so they should be there.Couldn't John hold off for 10 seconds or more on his DB and you just repeat your process one more time?
Then use that from then on.
I realise you have to make the changes all over again, but would then be it?
Private Declare Function GetComputerName _
Lib "kernel32" Alias "GetComputerNameA" ( _
ByVal lpBuffer As String, nSize As Long) As Long
Declare Function GetWinUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function apiGetFrequency Lib "kernel32" _
Alias "QueryPerformanceFrequency" ( _
ByRef Frequency As Currency) _
As Long
Private Declare Function apiGetTimeFast Lib "kernel32" _
Alias "QueryPerformanceCounter" ( _
ByRef Counter As Currency) _
As Long
Private Declare Function apiGetTimeSlow Lib "winmm.dll" _
Alias "timeGetTime" () As Long
' Already converted?
#If VBA7 Then 'A2010 or later (32-bit/64-bit)
Private Declare PtrSafe Function apiGetTime Lib "winmm.dll" Alias "timeGetTime" () As Long
Private lngStartTime As Long
#Else 'VBA6 (A2007 or earlier
Private Declare Function apiGetTime Lib "winmm.dll" Alias "timeGetTime" () As Long
Private lngStartTime As Long
#End If
Private Declare Function apiGetTime Lib "winmm.dll" _
Alias "timeGetTime" () As Long
Declare PtrSafe Sub wlib_AccColorDialog Lib "msaccess.exe" Alias "#53" _
(ByVal hWnd As Long _
, lngRGB As Long)
If John would like to proceed this way, why not.@AHeyne
Sorry. I meant that if John stopped changing his DB for a day or so, and you could either download the latest version from GitHub, or better still, have it sent by John directly to you. You make your changes for 64 bit and send back. That DB then becomes the defnitive DB to be continually amended by John from then on?
John,
There are a few Declares