ACC2000: "Too Many Fields Defined" Error Message Saving TableID: Q198504
|
When you save a table after you add a new field or change the properties of an existing field, you receive the message:
This message is followed by:Too many fields defined.
You receive these messages even though you have 255 or fewer fields defined in the table.Errors were encountered during save. Data types were not changed.
The internal column count that Microsoft Access uses to track the number of fields in the table has reached 255, even though you may have fewer than 255 fields in the table. This can happen because Access does not change the internal column count when you delete a field. Access also creates a new field (increasing the internal column count by 1) for every field whose properties you modify.
To free the internal column count for deleted fields or for fields whose
properties you modify, do one of the following:
-or-
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.aspNOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you need to reference the Microsoft DAO 3.6 Object Library.
' ****************************************************************
' Declarations section of the module
' ****************************************************************
Option Compare Database
Option Explicit
' ****************************************************************
' The Fill_Table() function creates a table in the current database
' named Field Test with 255 fields, each of which has a Text data
' type and a size of one character.
' ****************************************************************
Function Fill_Table()
Dim mydb As DAO.Database
Dim tbl As DAO.TableDef
Dim fld As DAO.Field
Dim i As Integer
Set mydb = CurrentDb()
Set tbl = mydb.CreateTableDef("Field Test")
For i = 0 To 254
Set fld = tbl.CreateField("Field" & CStr(i + 1))
fld.Type = dbText
fld.Size = 1
tbl.Fields.Append fld
Next i
mydb.TableDefs.Append tbl
End Function
Fill_Table
Too many fields defined.
Errors were encountered during the save operation. Fields were not added. Properties were not updated.
For more information about database specifications, click Microsoft Access Help on the
Help menu, type "Microsoft Access specifications" in the Office Assistant or the Answer Wizard,
and then click Search to view the topics returned.
Additional query words: prb
Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 6, 1999