Board index » delphi » Zero length String - SQL Error

Zero length String - SQL Error

I'm usuing D3 with an Access 97 Database.  On the data entry forms I have
the access fields displayed.  If data exists in the field and the user
erases the data and trys to post the update the following error is displayed
...."General SQL Error.... ### is a  zero-length string" or somthing like
that....

I know that if I set the field to null on exit if it is blank will solve
this problem, but is there a system setting somewhere that will set the SQL
" " to null ???? In a more general fashion.

Thanks,

 

Re:Zero length String - SQL Error


I cannot reproduce that behavior.  Is the underlying dataset a TTable or a
TQuery? What is the data type?

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:Zero length String - SQL Error


Thanks Bill, It is a TTable - MS Access 97.  The problem occurs when there
is data in a DBField that is connected to a table.  If you delete the data
in the field and try to save the record back, the SQL error occurs.

I thought that I remember some type of "Null for Blank" for Access
tables????  I may be wrong.  I have never had this problem with Pdox
tables.....

Thanks in Advance

Quote
Bill Todd (TeamB) wrote in message <6n9bua$23...@forums.borland.com>...
>I cannot reproduce that behavior.  Is the underlying dataset a TTable or a
>TQuery? What is the data type?

>--
>Bill

>(TeamB cannot answer questions received via email.)
>(To contact me for any other reason remove nospam from my address)

Re:Zero length String - SQL Error


Quote
>I'm usuing D3 with an Access 97 Database.  On the data entry forms I have
>the access fields displayed.  If data exists in the field and the user
>erases the data and trys to post the update the following error is displayed
>...."General SQL Error.... ### is a  zero-length string" or somthing like
>that....

Access tables have a property to Allow zero lenght strings.  If you don't have
this property set to true you will get the error you are experiencing when a
field is left blank.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Zero length String - SQL Error


Thanks .... Worked like a champ!

Quote
Brian Bushay TeamB wrote in message

<359f4df4.13601...@forums.borland.com>...
Quote

>>I'm usuing D3 with an Access 97 Database.  On the data entry forms I have
>>the access fields displayed.  If data exists in the field and the user
>>erases the data and trys to post the update the following error is
displayed
>>...."General SQL Error.... ### is a  zero-length string" or somthing like
>>that....

>Access tables have a property to Allow zero lenght strings.  If you don't
have
>this property set to true you will get the error you are experiencing when
a
>field is left blank.

>--
>Brian Bushay (TeamB)
>Bbus...@DataGuidance.com

Re:Zero length String - SQL Error


Hmm. I tried the same thing with an Access 97 table using a TTable and did
not have a problem changing a field to blank and posting the record.  Are
you sure there is no RI or other constraint on that field in the database?

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:Zero length String - SQL Error


Quote
> Access tables have a property to Allow zero lenght strings.  If you don't have
> this property set to true you will get the error you are experiencing when a
> field is left blank.

How can I set this property when I create my Access tables at runtime?

Achim

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:Zero length String - SQL Error


Quote
>How can I set this property when I create my Access tables at runtime?

I do not know of a way to set this from Delphi

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads