Re: Adding a field
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Wed, 19 Apr 2006 00:12:58 +0800
I don't think that AllowZeroLength can be set with DDL.
You can use DAO to set:
Currentdb.TableDefs("Table1").Fields("Field1").Properties("AllowZeroLength")
It is also possible through ADOX (though older versions can fail on this.)
BTW, I can hardly imagine why you would want this property set to True.
Every query or VBA routine that refers to the field must then test for a
zero-length string as well as a null, which seems error-prone, harder to
maintain, slower to develop, and slower to execute, for no benefit.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Darren" <D arren @pclegends.com> wrote in message
news:%23MBT8GwYGHA.3496@xxxxxxxxxxxxxxxxxxxxxxx
Very nice, couldn't find that anywhere.
Anything for "Allow Zero Length" to be true?
Thanks
"Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx> wrote in message
news:e7S027vYGHA.4884@xxxxxxxxxxxxxxxxxxxxxxx
Yes, it is rather annoying that JET 4 sets several properties
inconsistently, depending how you create the field.
AFAIK, there is no way to set the default behavior for DDL queries. But
if you execute them under ADO, you can use the WITH COMP option, e.g.:
CREATE TABLE Table1 (Field1 TEXT (50) WITH COMP);
I don't believe that works under DAO, so it probably won't work if you
try it in the query window. Has to be executed as:
CurrentProject.Connection.Execute "CREATE ...
"Darren" <D arren @pclegends.com> wrote in message
news:uQrUI2vYGHA.4752@xxxxxxxxxxxxxxxxxxxxxxx
When adding a field to a table from within the Access DB Designer, a
text field will default to "Unicode Compress" = True
When adding it through SQL it defaults to false.
Is there anyway to get them to default to true using SQL?
.
- References:
- Re: Adding a field
- From: Allen Browne
- Re: Adding a field
- Prev by Date: Re: Query SQL not working..
- Next by Date: RE: Update/Append/AddColumn
- Previous by thread: Re: Adding a field
- Next by thread: RE: Update/Append/AddColumn
- Index(es):
Relevant Pages
|