Dear MS Access Expert,
I have a slew of questions here. Please feel free to answer the one you wish to address.
1) According to this article you can speed up split MS Access applications by having the backend open as a VBA object. I wanted to get your opinion or experiences with this technique.
http://www.fmsinc.com/MicrosoftAccess/Performance/LinkedDatabase.html
2) According to this article decompile should reduce the size of your .MDB. I tried it yesterday and it didn’t reduce the size of my .MDBs. I use MS Access 2003. Should I decompile on a regular basis (to supposedly reduce size) or is this technique useful only when I have unexplained gremlins in my VBA code?
http://www.fmsinc.com/MicrosoftAccess/Performance/Decompile.asp
3) Autonumber as Primary Keys. I find this subject confusing as I experts have different opinions on this. Most support autonumber primary keys but others such as John L. Viescas has an entire section in his book “Building MS Access Applications” titled “Avoid Artificial Primary Keys in Tables.” There are strong arguments from both sides. Please comment about your experiences.
4) DLL files. What are the folders / directories the VBA compiler looks for DLL files before giving up? Is it System, System32, and the local folder which the .MDB resides in? What are DLL files? Is it compiled code? Are they written in a specific language? Why do developers choose to have DLL files instead of VBA Modules for certain solutions. For example I use Stephen Lebans’ mousehook.dll. Why didn’t he simple write this in a VBA module, what advantages did DLL give him?
5) Error Handling. I have read that it is good practice to put error handling in every sub, procedure and function. Why would I put an error handler on something like Me.mycontrol.setfocus? Isn’t this overdoing it? Also I often let child subroutines bubble up their errors to the parent child routine. I don’t see a problem with this as long as there is a customized error message eventually in the Stack call? Your thoughts?
6) Refrain from using Exit Function / Sub. I often use Exit function / sub in cases where the user selects vbNo in a message box. I don’t consider this bad style and I find the code easier to read vs. deeply nested code. What is your opinion?
7) Closing Objects and Setting to Nothing when finished. I don’t explicitly close my Recordsets or set them to Nothing at the end of subroutines. I thought the VBA garbage collector does this? Certain sites recommend closing Recordsets but not necessarly explicitly releasing the object with Set obj = Nothing. Can I continue my practice of not closing and releasing? This does save time, space and makes code shorter.
I have a slew of questions here. Please feel free to answer the one you wish to address.
1) According to this article you can speed up split MS Access applications by having the backend open as a VBA object. I wanted to get your opinion or experiences with this technique.
http://www.fmsinc.com/MicrosoftAccess/Performance/LinkedDatabase.html
2) According to this article decompile should reduce the size of your .MDB. I tried it yesterday and it didn’t reduce the size of my .MDBs. I use MS Access 2003. Should I decompile on a regular basis (to supposedly reduce size) or is this technique useful only when I have unexplained gremlins in my VBA code?
http://www.fmsinc.com/MicrosoftAccess/Performance/Decompile.asp
3) Autonumber as Primary Keys. I find this subject confusing as I experts have different opinions on this. Most support autonumber primary keys but others such as John L. Viescas has an entire section in his book “Building MS Access Applications” titled “Avoid Artificial Primary Keys in Tables.” There are strong arguments from both sides. Please comment about your experiences.
4) DLL files. What are the folders / directories the VBA compiler looks for DLL files before giving up? Is it System, System32, and the local folder which the .MDB resides in? What are DLL files? Is it compiled code? Are they written in a specific language? Why do developers choose to have DLL files instead of VBA Modules for certain solutions. For example I use Stephen Lebans’ mousehook.dll. Why didn’t he simple write this in a VBA module, what advantages did DLL give him?
5) Error Handling. I have read that it is good practice to put error handling in every sub, procedure and function. Why would I put an error handler on something like Me.mycontrol.setfocus? Isn’t this overdoing it? Also I often let child subroutines bubble up their errors to the parent child routine. I don’t see a problem with this as long as there is a customized error message eventually in the Stack call? Your thoughts?
6) Refrain from using Exit Function / Sub. I often use Exit function / sub in cases where the user selects vbNo in a message box. I don’t consider this bad style and I find the code easier to read vs. deeply nested code. What is your opinion?
7) Closing Objects and Setting to Nothing when finished. I don’t explicitly close my Recordsets or set them to Nothing at the end of subroutines. I thought the VBA garbage collector does this? Certain sites recommend closing Recordsets but not necessarly explicitly releasing the object with Set obj = Nothing. Can I continue my practice of not closing and releasing? This does save time, space and makes code shorter.