Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rating: Thread Rating: 20 votes, 5.00 average. Display Modes
Old 05-21-2009, 03:38 AM   #1
DCrake
Administrator
 
DCrake's Avatar
 
Join Date: Jun 2005
Location: Burnley, Lancashire
Posts: 8,634
Thanks: 8
Thanked 318 Times in 208 Posts
DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light
Send a message via Skype™ to DCrake
The Ten Commandments of Access

Thow normally not in the right section, I felt, that as all newbies visit this section first this is the best place to address the above.

The Ten Commandments of Access

And it came to pass that the cries and lamentations of the Access newbies were heard on high by the gods of the Database, and their hearts were moved to pity for their followers. And they opened their mouths and spake, saying: "Nevermore shall the young and innocent wander witless on their journeys!
We shall provide guidance to them, yea, and to all who wish to seek the paths of wisdom." And they caused these commandments to be written and placed before the eyes of those seeking enlightenment.
So heed the words of those who have come before you, and keep these commandments in thine heart as thou dost create thy Database application. If thou shalt only follow these commandments thy burden shall be made light and thy path shall be made straight.
  1. Thou shalt design normalized tables and understand thy fields and relationships before thou dost begin.
  2. Thou shalt never allow thy users to see or edit tables directly, but only through forms and thou shalt abhor the use of "Lookup Fields" which art the creation of the Evil One.
  3. Thou shalt choose a naming convention and abide by its wisdom and never allow spaces in thy names.
  4. Thou shalt write comments in your procedures and explain each variable.
  5. Thou shalt understand error handling and use it faithfully in all thy procedures.
  6. Thou shalt split thy databases.
  7. Thou shalt not use Autonumber if the field is meant to have meaning for thy users.
  8. Thou shalt not copy and paste other people's code without at least attempting to understand what it does.
  9. Thou shalt not use "SendKeys", "Smart Codes" or "GoTo" (unless the GoTo be part of an OnError process) for these will lead you from the path of righteousness.
  10. Thou shalt back-up thy database faithfully, working not on thy Production Database, but on the Prototype Copy, as it is right and good to do.
Thus spake the gods of the Database, and blessed be their names! And Blessed, too, are those who contribute to the Access Newsgroup - giving freely of themselves to serve those who hunger and thirst for knowledge and understanding!

__________________
David Crake


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
The Home of Simple Software Solutions.

O/S Windows XP (SP3) & Windows 7 64bit
Access 2003 (version 11.0)
Access 2007 (version 12.0)

Remember when posting sample databases you will get a better response if it is pre Access 2007 - not all people have it installed.
DCrake is offline   Reply With Quote
The Following 65 Users Say Thank You to DCrake For This Useful Post:
akuraim (03-26-2016), bcomb (01-12-2017), bevc (08-07-2015), bigal.nz (07-09-2016), BlueIshDan (06-17-2014), blu_macey (03-31-2015), ciso (11-27-2012), Craig Alan (12-31-2016), Daz (02-15-2013), docxyz (11-03-2014), eddix99 (09-19-2018), egodx (10-30-2012), EL_Gringo (08-26-2012), EternalMyrtle (05-18-2013), Factor21 (03-11-2016), FlorencePS (04-26-2011), gconeuk (03-03-2015), George21 (05-20-2014), gerrythefish (10-12-2014), gootis (03-31-2011), grakita (04-08-2016), greenear (01-27-2012), gus2020 (09-26-2014), HarryH (11-12-2011), hassanogaibi (06-28-2016), hollyneal (01-06-2012), ITempleman (05-06-2016), jadehawk (04-26-2015), Jeffr.Lipton (10-23-2018), jenkinsearl35 (09-25-2013), Jim Dudley (02-19-2012), kimberlin (07-22-2011), Kirbstone (11-30-2012), Lavania (07-14-2013), MaleNurse325 (05-31-2018), mancubus (01-23-2016), MartinC (12-01-2012), Martinchox (11-06-2015), marvo (09-23-2018), meanmama210 (09-07-2012), milkbone71 (09-27-2012), mjdemaris (06-29-2016), mulla25 (02-19-2012), murray83 (11-29-2017), noelcass (11-04-2015), nofeara (05-20-2015), Notiophilus (12-31-2017), pheidlauf (07-11-2013), Protege (11-03-2017), raymondo1968 (09-17-2014), ROgden (03-01-2012), SaharaDawn (06-27-2012), selain (11-07-2013), Shandy (04-25-2011), Shardool (04-04-2013), smig (11-03-2014), sneuberg (10-24-2016), Sodslaw (06-06-2018), SteveStew44 (11-13-2014), The Cavalry (03-08-2017), UnrulyJulie (03-15-2013), vash011390 (11-23-2015), wanderabaht (12-13-2017), yaoi28lover (04-21-2014), zunither (11-05-2012)
Old 05-21-2009, 05:05 AM   #2
HiTechCoach
Newly Registered User
 
HiTechCoach's Avatar
 
Join Date: Mar 2006
Location: Oklahoma City, OK
Posts: 4,243
Thanks: 8
Thanked 155 Times in 143 Posts
HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough
Re: The Ten Commandments of Access

http://www.mvps.org/access/tencommandments.htm

and here are a few additions I have heard:

> Thou shalt never allow spaces or any other non-alphameric characters in thy names.


>Thou shalt write comments in your procedures and explain each variable. Only necessary if you write spaghetti code and use abbreviations in your variable names.

>Thou shalt understand error handling and use it faithfully in all thy procedures. If you understand error handling you know that it is not needed in every procedure.


> Thou shalt use the compiler directive, Option Explicit, and thou shalt explicitly define recordsets with the appropriate class object, DAO or ADODB.


> Thou shalt not use "I don't have permission to change it" as an excuse for not fixing bad table structure.

> thou shalt never store values from calculated fields
__________________
Boyd Trimmell
Specializing in Accounting, CRM, and Business solutions
Microsoft Access MVP 2010-2015 , aka
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by HiTechCoach; 05-21-2009 at 06:33 AM.
HiTechCoach is offline   Reply With Quote
The Following 5 Users Say Thank You to HiTechCoach For This Useful Post:
bambangerfandi (02-17-2011), blu_macey (03-31-2015), grakita (04-08-2016), hassanogaibi (06-28-2016), yaoi28lover (04-21-2014)
Old 05-21-2009, 06:28 AM   #3
gemma-the-husky
Super Moderator
 
gemma-the-husky's Avatar
 
Join Date: Sep 2006
Location: UK
Posts: 13,462
Thanks: 51
Thanked 949 Times in 918 Posts
gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all
Re: The Ten Commandments of Access

DC asked the Oracle "how much are these commandments?"

The Oracle said "They are free"

DC said "Then I will take ten"


Quote:
Commandment 9
Thou shalt not use "SendKeys", "Smart Codes" or "GoTo" (unless the GoTo be part of an OnError process) for these will lead you from the path of righteousness.
but note that I have broken this commandment with regularity, and have not yet been struck down.


Some further possibilities


"Thou will take heed of the scope of variables. Thou will be especially careful not to unwittingly change variables passed as byref arguments, (for this is the default setting, which is an abomination to me) for this will verily produce strange side effects which will be hard to trace."

"Thou will become familiar with the usage of breakpoints and the F8 key"

"Thou will become familiar with the debug window"

"Thou will know and love the nz() function"

__________________
Dave (Male!)
Gemma was my dog

if a poster helps you, please click the scales at the top right of this posting, or use the thanks button alongside.
gemma-the-husky is offline   Reply With Quote
The Following 3 Users Say Thank You to gemma-the-husky For This Useful Post:
blu_macey (03-31-2015), eddix99 (09-19-2018), hassanogaibi (06-28-2016)
Old 05-21-2009, 06:34 AM   #4
Rabbie
Super Moderator
 
Rabbie's Avatar
 
Join Date: Jul 2007
Location: Returning to Scotland
Posts: 5,906
Thanks: 110
Thanked 75 Times in 67 Posts
Rabbie is a jewel in the rough Rabbie is a jewel in the rough Rabbie is a jewel in the rough
Re: The Ten Commandments of Access

Quote:
Originally Posted by gemma-the-husky View Post
DC asked the Oracle "how much are these commandments?"

The Oracle said "They are free"

DC said "Then I will take ten"

<<< Commandment 9
Thou shalt not use "SendKeys", "Smart Codes" or "GoTo" (unless the GoTo be part of an OnError process) for these will lead you from the path of righteousness. >>>


but note that I have broken this commandment with regularity, and have not yet been struck down.


Some further possibilities


"Thou will take heed of the scope of variables. Thou will be especially careful not to unwittingly change variables passed as byref arguments, (for this is the default setting, which is an abomination to me) for this will verily produce strange side effects which will be hard to trace."

"Thou will become familiar with the usage of breakpoints and the F8 key"

"Thou will become familiar with the debug window"

"Thou will know and love the nz() function"
Good suggestions especially especially the NZ() function.

In Commandment 9 i feel that over use of GoTo can lead to so-called Spaghetti coding that can be a nightmare to debug so I limit my use of it whereever possible
__________________
The best solution is the simplest one that meets all requirements.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Rabbie is offline   Reply With Quote
The Following User Says Thank You to Rabbie For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-21-2009, 06:51 AM   #5
Lil' Rascal
y = x
 
Lil' Rascal's Avatar
 
Join Date: Feb 2009
Location: Sin City
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Lil' Rascal is on a distinguished road
Re: The Ten Commandments of Access

Quote:
Originally Posted by G-T-H
"Thou will know and love the nz() function"
Most excellent.

Can I throw a couple of thoughts out there?

"Take heed mine child and keep thine Immediate Window (ctrl+G) close at hand, for the BreakPoint draweth nigh."

"Be vigilant and never waiver in thine Watches as thou preparest for Deployment."
__________________
Humanity is a parade of Fools, and I am at the front of it twirling a baton. - Odd Thomas
Lil' Rascal is offline   Reply With Quote
The Following User Says Thank You to Lil' Rascal For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-21-2009, 06:54 AM   #6
Atomic Shrimp
Humanoid lifeform
 
Join Date: Jun 2000
Location: Portsmouth, England
Posts: 1,954
Thanks: 0
Thanked 8 Times in 7 Posts
Atomic Shrimp has a spectacular aura about Atomic Shrimp has a spectacular aura about
Re: The Ten Commandments of Access

I shan't add any commandments, lest the Lords of Access smite me, but how about a beattitude?

Blessed are those who post again after their question is answered, for they will be assisted in future.
Atomic Shrimp is offline   Reply With Quote
The Following 2 Users Say Thank You to Atomic Shrimp For This Useful Post:
brharrii (07-23-2012), hassanogaibi (06-28-2016)
Old 05-21-2009, 08:12 AM   #7
Atomic Shrimp
Humanoid lifeform
 
Join Date: Jun 2000
Location: Portsmouth, England
Posts: 1,954
Thanks: 0
Thanked 8 Times in 7 Posts
Atomic Shrimp has a spectacular aura about Atomic Shrimp has a spectacular aura about
Re: The Ten Commandments of Access

Woe betide any who plan their application to require constant design change to accomodate new data of the same kind, for they will never be released of the burden of development.

Atomic Shrimp is offline   Reply With Quote
The Following User Says Thank You to Atomic Shrimp For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-26-2009, 02:39 AM   #8
DCrake
Administrator
 
DCrake's Avatar
 
Join Date: Jun 2005
Location: Burnley, Lancashire
Posts: 8,634
Thanks: 8
Thanked 318 Times in 208 Posts
DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light DCrake is a glorious beacon of light
Send a message via Skype™ to DCrake
Re: The Ten Commandments of Access

Dave (Gemma)

Your comment about Sendkeys

I have tried to use sendkeys in a VB project and Vista does not like it when you try and make a exe out of it as it treats this as a threat to security. Don't know how Access and Vista work together on this but it woould be nice to know.

David
__________________
David Crake


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
The Home of Simple Software Solutions.

O/S Windows XP (SP3) & Windows 7 64bit
Access 2003 (version 11.0)
Access 2007 (version 12.0)

Remember when posting sample databases you will get a better response if it is pre Access 2007 - not all people have it installed.
DCrake is offline   Reply With Quote
The Following User Says Thank You to DCrake For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-26-2009, 02:54 AM   #9
neileg
AWF VIP
 
neileg's Avatar
 
Join Date: Dec 2002
Location: Newcastle, England
Posts: 5,975
Thanks: 0
Thanked 8 Times in 8 Posts
neileg has a spectacular aura about neileg has a spectacular aura about
Re: The Ten Commandments of Access

How about:
"Thou shalt understand datatypes and pick the most appropriate one for your data"
"Thou shalt applying formatting at the last possible opportunity for it is wonderous so to do"
"Thou shalt understand how dates are stored and the wonderous ways that dates are displayed in the many countries of the world. Know well that SQL abhors non-US date formats"
"Thou shalt not link thy databases to spreadsheets. The cloven hooves and wrongfull thoughts of spreadsheet users are an abomination unto the Gods of Data"
__________________
You can't always get what you want, but if you try sometimes you may just get what you need - Rolling Stones

Cheers, Neil
neileg is offline   Reply With Quote
The Following User Says Thank You to neileg For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-26-2009, 03:16 PM   #10
gemma-the-husky
Super Moderator
 
gemma-the-husky's Avatar
 
Join Date: Sep 2006
Location: UK
Posts: 13,462
Thanks: 51
Thanked 949 Times in 918 Posts
gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all
Re: The Ten Commandments of Access

Quote:
Originally Posted by DCrake View Post
Dave (Gemma)

Your comment about Sendkeys

I have tried to use sendkeys in a VB project and Vista does not like it when you try and make a exe out of it as it treats this as a threat to security. Don't know how Access and Vista work together on this but it woould be nice to know.

David

Its Goto's I use really

all i ever do with sendkey is

sendkey "{esc}", now and again.

------------
Yes, congrats to Burnley - you can't have enough teams playing in Claret and Blue, can you?
__________________
Dave (Male!)
Gemma was my dog

if a poster helps you, please click the scales at the top right of this posting, or use the thanks button alongside.
gemma-the-husky is offline   Reply With Quote
The Following User Says Thank You to gemma-the-husky For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-26-2009, 11:13 PM   #11
Atomic Shrimp
Humanoid lifeform
 
Join Date: Jun 2000
Location: Portsmouth, England
Posts: 1,954
Thanks: 0
Thanked 8 Times in 7 Posts
Atomic Shrimp has a spectacular aura about Atomic Shrimp has a spectacular aura about
Re: The Ten Commandments of Access

Never shalt thou permit a user to enter a value as free text, if that value is to be subsequently tested as an attribute or control value.

And

Never shalt thou store more than one value in a single field, for in the later separate handling of those values, there will be much weeping and gnashing of teeth.
Atomic Shrimp is offline   Reply With Quote
The Following User Says Thank You to Atomic Shrimp For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-27-2009, 11:32 AM   #12
Rebecca G
Registered User
 
Join Date: May 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Rebecca G is on a distinguished road
Re: The Ten Commandments of Access

I am primarily a self taught creater of Access databases and, create databases for others to use. I am particularly interested in commandment (10 Thou shalt back-up thy database faithfully, working not on thy Production Database, but on the Prototype Copy, as it is right and good to do. ). Is there a good process with which I can make changes to database objects and then roll the revised version out to the front-line folks without stopping production?
Rebecca G is offline   Reply With Quote
The Following User Says Thank You to Rebecca G For This Useful Post:
hassanogaibi (06-28-2016)
Old 05-27-2009, 11:35 AM   #13
HiTechCoach
Newly Registered User
 
HiTechCoach's Avatar
 
Join Date: Mar 2006
Location: Oklahoma City, OK
Posts: 4,243
Thanks: 8
Thanked 155 Times in 143 Posts
HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough
Re: The Ten Commandments of Access

Quote:
Originally Posted by Rebecca G View Post
I am primarily a self taught creater of Access databases and, create databases for others to use. I am particularly interested in commandment (10 Thou shalt back-up thy database faithfully, working not on thy Production Database, but on the Prototype Copy, as it is right and good to do. ). Is there a good process with which I can make changes to database objects and then roll the revised version out to the front-line folks without stopping production?
See:

Sharing an Access Database
__________________
Boyd Trimmell
Specializing in Accounting, CRM, and Business solutions
Microsoft Access MVP 2010-2015 , aka
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
HiTechCoach is offline   Reply With Quote
The Following User Says Thank You to HiTechCoach For This Useful Post:
The Cavalry (03-08-2017)
Old 05-29-2009, 10:27 AM   #14
seopositive2
Registered User
 
Join Date: May 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
seopositive2 is on a distinguished road
Re: The Ten Commandments of Access

I really enjoy to read this nice discussion about the The Ten Commandments of Acces.
seopositive2 is offline   Reply With Quote
Old 06-01-2009, 09:34 AM   #15
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 12,441
Thanks: 62
Thanked 1,172 Times in 1,072 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: The Ten Commandments of Access

I would only disagree on the near-absolute admonishment regarding GoTo.

While spaghetti code is surely to be abhorred, there are prececents even within Pascal, the brain-child of Niklaus Wirth, and it was Wirth who first stated that GoTo was obsolete. It isn't now and never will be obsolete as long as you have convoluted If/Then/Else nesting for which a short-cut to the end of a subroutine is appropriate. And as we all know, as much as we try to anticipate the convolution, sometimes there is no other way to do it.

You can end a segment with an End While, End Loop, End If and still write related code afterwards, but if you try to do an End Sub, it means something different syntactically.

You can, of course, do a Return in-line, buried in the middle of a complex nested, multi-layered IF block, and that is a short, syntactically correct way to do that, BUT... there is another rule or at least strong admonishment in general programming that says that all subroutines should have a single return-point (so you can see what is being returned by the routine.) The GoTo and Single Return rules are in conflict, and I treat the Single Return rule as the stronger of the two.

Basically, I would argue that real-world compilers aren't smart enough to do without a GoTo as a way to say "I'm done in the middle of this subroutine/function/code sequence so take the common exit/return/step-to-next-sequence point." It's the "done in the middle" aspect that, if you couldn't say that, would multiply the size of your code geometrically as the complexity grows linearly.

GoTo when used to jump from the front of the main code to the end is probably not such a good idea. GoTo when used simply to get out of a messy nesting is appropriate if re-casting the nesting doubles the size of the source code segment. And I've run into that particular bit of nastiness far too often to say it is rare.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.

Last edited by The_Doc_Man; 06-01-2009 at 09:35 AM. Reason: clean up my English
The_Doc_Man is offline   Reply With Quote
The Following 3 Users Say Thank You to The_Doc_Man For This Useful Post:
Acceesbility (01-18-2017), kawaisunn (11-19-2014), NauticalGent (05-25-2016)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 97 Linking to tables in Access 2000 Amileaux General 6 10-16-2013 04:55 AM
FTP Upload Module gisash1 General 12 01-21-2010 05:07 AM
Beginner's Guide to ODBC Banana Access FAQs 1 06-18-2009 08:10 PM
User Defined Type - Access 97 to 2000/2002 Mile-O Access FAQs 0 12-01-2005 06:35 AM
Access Charts/Graphs durdle17 Reports 5 10-04-2004 02:42 AM




All times are GMT -8. The time now is 06:56 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World