Selasa, 25 April 2017

Re: [MS_AccessPros] Autonumber Default Value = 0; Good or Bad?

 

you're welcome, David ~ happy to help

you can use this free tool to find all the fields with a default value ... in case you missed any

Analyzer for Microsoft Access on CodePlex (will be moving to another site since CodePlex is being closed, but this link will work for awhile):
http://Analyzer.CodePlex.com

here is a video -- it is a few years old, and the Analyzer does a lot more now, but this goes over the basics 

video: Analyzer for Microsoft Access
http://www.youtube.com/watch?v=st3dcpVjwl0

respectfully,
crystal
 
~ have an awesome day ~

On 4/24/2017 9:47 PM, david.pratt@outlook.com [MS_Access_Professionals] wrote:
OK, thanks this makes sense.  Since Access automatically made is 0, I just accepted it.  I will go back into all my tables and remove the default value.


---In MS_Access_Professionals@yahoogroups.com, <strive4peace2008@...> wrote :

adding onto what John said ...

except for a couple versions, Access automatically supplies a Default Value of 0 when a Number data type is chosen.  Probably so math equations would not have to be wrapped with NZ to work .... but a Default Value is rarely appropriate for a foreign key -- and even then, it would probably be something different.  Therefore, be sure to always DELETE the Default Value of 0 for numeric foreign keys (and possibly other numbers too) unless you have given it consideration and it is truly what you want.

respectfully,
crystal
 
~ have an awesome day ~


On 4/24/2017 10:39 AM, John Viescas JohnV@... [MS_Access_Professionals] wrote:
Then get rid of the 0 default value.
 
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Apr 24, 2017, at 5:28 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



OOPS! my mistake with mis-written question.

These are not autonumber fields, they are child key fields of the number type but are not autonumber.


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

David-

It doesn't matter - that Default 0 will be ignored by an AutoNumber field.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Apr 24, 2017, at 5:05 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have a number of autonumber ID fields.  When I create one of these fields Access always creates a default value of 0 (zero).  Is this a good idea to do, or is it better to have no default value for these fields?










__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar