473,395 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Why does the Field Size of a Textbox have to be declared?

1
An Access text field can contain a maximum number of 255 characters. Why is it important to assign a field size to text fields and why do you think its only 255 characters?
Nov 11 '08 #1
4 1674
tdw
206 100+
Being a non-expert I can only tell you what my understanding is, so if anyone wants to correct me or expand on it please do.

My understanding is that limiting the number of characters available to a text field is for reducing it's size, which helps make the overall size of the file smaller, and helps speed up queries. If you need a text field with more characters, then you need to make it a memo field instead of a text field. However, I've been reading about dangers of corruption associated with memo fields. I use a memo field and have had no problems.
Nov 11 '08 #2
missinglinq
3,532 Expert 2GB
As tdw has stated, if you need a field to hold more than 255 characters you need to use a Memo field, which can hold in excess of 64K. The problems with corruption that tdw cited were with earlier versions of Access (v97 and earlier, I believe) and have long since been resolved.

If a database is set up properly, text fields seldom need to be more than 255 characters long. One of the Cardinal rules to having a well designed, normalized database is that no single field will contain more than one individual piece of data. Data stored in Memo fields should be restricted to "notes" or narrative type information, such as a salesman's notes on a customer visit or a doctor's progress notes on a patient.

Working primarily in a Heath Care environment, I've used Memo fields extensively for a number of years, without ever having a problem. The secret is to follow one single rule:

Never, never, never place data in a Memo field if there any possibility that you will ever need to search, sort, parse or in any other way manipulate the data!

Because many queries perform some of these functions, you have to take care in using them in queries or they will be truncated to 255 characters. . Allen Browne has an excellent article explaining how to deal with Memo field and queries:

http://allenbrowne.com/ser-63.html

Welcome to Bytes!

Linq ;0)>
Nov 11 '08 #3
tdw
206 100+
That's exactly how I use memo fields as well: special instructions and notes about a particular order. The only kind of "searching" that occurs in that field is by using the Find/Replace feature in the menu bar.
Nov 11 '08 #4
mshmyob
904 Expert 512MB
As indicated one of the reasons for assigning a size to a text field is for size of database file. It is one of the same reason we chose either byte, integer, double, or long.

In a text field each character requires 2 bytes. If you only think the data in that field will be 25 characters long at most then set it to 25 so that it will only allocate 50 bytes as opposed to 510 bytes. Now expand that and assume you have 20,000 records. Multiply by 20,000 and see the difference.

As to why 255. It is really 256 since no value counts. I assume 256 would allow each member of the basic character set to be stored to the field.

I think the memo thing has been fully explained by Linq.

cheers,
Nov 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michelle | last post by:
Hi all I have used knowledge base article 112747 to improve my subforms performance. I am using Access 97. I have a main form where i put an extra textbox which concatenated TeamID WeekNum...
9
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
6
by: Carlos | last post by:
Hi all, I am trying to access a public field of another form class within the same namespace. The field is public, what is the best way to access it from a different class? I defined as private...
3
by: Rick | last post by:
I have an interesting problem when I run the following code in Netscape (7.02) vs. IE. This page works great in IE and all my controls bring up the validation summary dialog box if the required...
2
by: Robert Wagner | last post by:
I've created a page using VS.NET and page validator controls. The client side validation works fine on IE, but does not even activate under "alternate" browsers like Mozilla, Opera, etc. Why is...
1
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a...
2
by: tshad | last post by:
I am getting an error on a object name that doesn't exist (according to asp.net), but if you look at the trace, it does. Here is the error: ...
6
by: marktxx | last post by:
Although the C90 standard only mentions the use of 'signed int' and 'unsigned int' for bit-fields (use 'int' at your own risk) and C99 adds _Bool. It seems that most compilers create the size of...
4
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.