Re: Adding a field

Tech-Archive recommends: Speed Up your PC by fixing your registry



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?


.



Relevant Pages

  • Re: Dynamic VB Code Behind
    ... 'Dynamic Master/Detail Controls', but as I started abstracting the ... In this case when the user selects which report they want to run from a ddl ... My code will read from sql that it needs to create a ddl ... 'save' the SelectedIndexChanged event code in sql and send it to an Execute ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Executing multiple DDL statements using C#
    ... GO is not DDL, it is SQL Query Analyzer specific. ... execute each segment array element. ... > I'm having trouble executing multiple DDL statements in one SQL file. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: transfering table design
    ... What have you got against SQL? ... Anyway you can also use the DAO Create methods instead. ... poor help system. ... Search Help for DDL. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: ON DELETE CASCADE
    ... I think it is pretty clear that you cannot use Access SQL DDL to set up ... you can use DAO to do this. ... the relation with cascade deletes all in DAO: ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Strange problem with max()?
    ... Below you can see select sql ... When I execute the entire statement, ... or whatever you need to do to make it a scalar correlated subquery. ... Without DDL, it is hard to say more. ...
    (comp.databases.sybase)