SQL,Access and Allow Zero Length

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am try to use SQL to create a table including a field which does not allow
Zero Length text input. I can not make it. Could someone tell me how?

Thanks in advance
 
I don't believe you can set the Allow Zero Length property using a DDL query
statement.

Use DAO or ADOX.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you are using a db engine that allows CHECK CONSTRAINTs you could do
something like this:

CRATE TABLE table_name (
col1 INTEGER PRIMARY KEY ,
col2 VARCHAR(50) ,
CONSTRAINT NoZeroLength CHECK (LEN(col2) > 0)
)

Reconsidering.... Using NOT NULL in the column definition will probably
do the trick. You'd have to test to be sure.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQSTsk4echKqOuFEgEQKB2wCgmVkc4cIPacTuQqdMrbLPUyHUnQoAn3hk
dbBlwBSpRakSbcTdDeIct1eX
=Sxs4
-----END PGP SIGNATURE-----
 
Back
Top