Board index » delphi » Access error: field cannot be a zero-lenght string

Access error: field cannot be a zero-lenght string

a general BDE Error

In Access from Office 97, DAO 3.5, D3 C/S, BDE 4.51 (also installed D4 C/S
with BDE 5.0)

and what is happening? If I start editing a field (from blank) and then
backspace the contents I can't do a post! the error :' field cannot be a
zero-lenght string' is appearing.

Other fields are working fine. There are no constraints in the Dataset or in
the Table.

If you know what is happening please reply

thanks,

Edward Spelt

 

Re:Access error: field cannot be a zero-lenght string


Quote
Edward Spelt wrote:
> a general BDE Error

> In Access from Office 97, DAO 3.5, D3 C/S, BDE 4.51 (also installed D4 C/S
> with BDE 5.0)

> and what is happening? If I start editing a field (from blank) and then
> backspace the contents I can't do a post! the error :' field cannot be a
> zero-lenght string' is appearing.

> Other fields are working fine. There are no constraints in the Dataset or in
> the Table.

> If you know what is happening please reply

> thanks,

> Edward Spelt

I think this is an Access error message.  I have an Access database to which I
attempted to add another string key.  I got the same message... can't have a
zero length string... for the new key field.

Is this a key field?  If so, I'd say Access does not allow zero length keys.

--
Wayne Herbert
Manager, Computer Products
Key Maps, Inc.
1411 West Alabama
Houston, TX  77006

Vox:  713.522.7949
Fax:  713.521.3202
Email:  wherb...@keymaps.com

Vyizder mororsiz assesden derizorsiz?

Re:Access error: field cannot be a zero-lenght string


When you create a string field in Access I believe the default is to not
allow null values.  Change this setting for all fields in Access that you
want to leave blank.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:Access error: field cannot be a zero-lenght string


no Wayne,  it's not a key field. I think the answer of Bill is most likeley
the solutions, but I will dubbelcheck the answer of Ross too.

Quote
Wayne Herbert wrote in message <35F693DF.11134...@keymaps.com>...
>Edward Spelt wrote:

>> a general BDE Error

>> In Access from Office 97, DAO 3.5, D3 C/S, BDE 4.51 (also installed D4
C/S
>> with BDE 5.0)

>> and what is happening? If I start editing a field (from blank) and then
>> backspace the contents I can't do a post! the error :' field cannot be a
>> zero-lenght string' is appearing.

>> Other fields are working fine. There are no constraints in the Dataset or
in
>> the Table.

>> If you know what is happening please reply

>> thanks,

>> Edward Spelt

>I think this is an Access error message.  I have an Access database to
which I
>attempted to add another string key.  I got the same message... can't have
a
>zero length string... for the new key field.

>Is this a key field?  If so, I'd say Access does not allow zero length
keys.

>--
>Wayne Herbert
>Manager, Computer Products
>Key Maps, Inc.
>1411 West Alabama
>Houston, TX  77006

>Vox:  713.522.7949
>Fax:  713.521.3202
>Email:  wherb...@keymaps.com

>Vyizder mororsiz assesden derizorsiz?

Re:Access error: field cannot be a zero-lenght string


There are actually two field-properties which are related to this (Allow
Zero Length and Required). This is what the online help says:

Required        AllowZeroLength User's action           Value entered
No              No              Presses ENTER           <Null>
                                Presses SPACEBAR        <Null>
                                Types " "             (not allowed)

Yes             No              Presses ENTER           (not allowed)
                                Presses SPACEBAR        (not allowed)
                                Types " "             (not allowed)

No              Yes             Presses ENTER           <Null>
                                Presses SPACEBAR        <Null>
                                Types " "             <Zero-length string>

Yes             Yes             Presses ENTER           (not allowed)
                                Presses SPACEBAR        <Zero-length string>
                                Types " "             <Zero-length string>

--
Henri Suuronen

Re:Access error: field cannot be a zero-lenght string


Quote
Edward Spelt wrote:
> no Wayne,  it's not a key field. I think the answer of Bill is most likeley
> the solutions, but I will dubbelcheck the answer of Ross too.

The other posters are correct.  If you look at your Access database in design
view, and click on the field in question, I bet the option, "Allow Zero Length"
will be set to 'no'.  Hey, I learn something everyday.

--
Wayne Herbert
Manager, Computer Products
Key Maps, Inc.
1411 West Alabama
Houston, TX  77006

Vox:  713.522.7949
Fax:  713.521.3202
Email:  wherb...@keymaps.com

Vyizder mororsiz assesden derizorsiz?

Re:Access error: field cannot be a zero-lenght string


Hello Ross,

I think this is not the case because the other fields are working fine. But
I will dubbel check this.

thanks

Edward

Quote
Ross C. Williams wrote in message <35f698d8.3290...@forums.inprise.com>...
>There is a setting in Access for string fields as to whether they allow
null
>values. The default setting is that they don't accept null values, you have
to
>reset that setting in the Table designer in Access. There is probably a way
to
>do it in Delphi using code, but I don't know what it is. If you need to do
that
>you may want to look at the CreateOleObject and the DAO commands for
modifying
>tables.

>On Wed, 9 Sep 1998 15:26:29 +0200, "Edward Spelt" <E...@DASC.NL> wrote:

>>a general BDE Error

>>In Access from Office 97, DAO 3.5, D3 C/S, BDE 4.51 (also installed D4 C/S
>>with BDE 5.0)

>>and what is happening? If I start editing a field (from blank) and then
>>backspace the contents I can't do a post! the error :' field cannot be a
>>zero-lenght string' is appearing.

>>Other fields are working fine. There are no constraints in the Dataset or
in
>>the Table.

>>If you know what is happening please reply

>>thanks,

>>Edward Spelt

>Ross Williams

>To Email me:
>the "won" in "spiritwon.com" should be replaced by "one"

Re:Access error: field cannot be a zero-lenght string


Thanks Bill that was the solution!

That I overlooked this one...

by Edward

Quote
Bill Todd (TeamB) wrote in message <6t79eh$9f...@forums.borland.com>...
>When you create a string field in Access I believe the default is to not
>allow null values.  Change this setting for all fields in Access that you
>want to leave blank.

>--
>Bill Todd
>(Sorry but TeamB cannot answer questions received via email)
>(Remove nospam from my email address to contact me for any other reason)

Other Threads