characters

M

Miguel Vivar

I would like to know if the number of carachters in a field name can be
increased. I know that the limi is 64.
 
B

Bruce Rusk

I can't imagine a good reason for doing this either, but it is possible in a
roundabout way that reveals a bug in of sorts in Access (at least 2003,
which is what I'm using):

If you create a query in the QBE grid and create an alias longer than 64
characters, it works fine (though it shouldn't, since the Jet maximum is
supposed to be 64). You can test it by creating a simple select query where
one of the fields is aliased as something like

very_very_long_name_far_too_long_to_be_useful_to_anyone_in_fact_77_characters

it will work and display fine (I've made aliases 200+ characters long this
way). You can save it, view data in it, and even go into the SQL view as see
the following:

SELECT ID, MyField AS
very_very_long_name_far_too_long_to_be_useful_to_anyone_in_fact_77_characters
FROM tblSomething;

But the moment you try to edit the SQL and then save it or change views, the
parser realizes that the alias is longer than 64 characters and throws an
error. Obviously there's a check that should be happening but isn't.

You can then use the query with the 64+ character alias in other queries,
and there, surprisingly, the long alias does NOT cause an error, even if you
edit the SQL.

So yes, there IS (but dangerously, since who knows what the other
implications of this would be) a way to have fieldnames over 64 characters,
by using long and technically illegal aliases.

HTC (hope this confuses),

Bruce
 
J

John Vinson

I would like to know if the number of carachters in a field name can be
increased. I know that the limi is 64.

Don't confuse data STORAGE with data DISPLAY.

A table field name could be X, or CorpName, or any other short (<64,
preferably <20 byte name).

The data in this field can be displayed on a Form or Report next to a
label with up to 32,768 characters in it.

Use the tools Access provides. You're not limited to table datasheets
and fieldnames as data presentation tools - which is a good thing,
since that is a VERY limited data display toolkit!

John W. Vinson[MVP]
 
B

Brendan Reynolds

In addition to the risks that Bruce has already mentioned, there's probably
a fairly high risk that this might not continue to work in later versions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top