dbfpy - cannot store new record

David Lyon david.lyon at preisshare.net
Thu May 21 18:05:29 EDT 2009


well, dbfpy isn't super sophisticated.

If you make your own code fixes, maybe you can provide them
back to the package author.


On Thu, 21 May 2009 17:53:38 +0200, Laszlo Nagy <gandalf at shopzeus.com>
wrote:
> Here is the next problem. For boolean/logical fields, I can set their 
> value to True/False easily. However, setting NULL seems impossible:
> 
> rec = tbl.newRecord()
> rec["SOMEFIELD1"] = True # Works fine
> rec["SOMEFIELD2"] = False # Works fine
> rec["SOMEFIELD3"] = None # Will store False
> rec["SOMEFIELD3"] = 0 # Will store False
> rec["SOMEFIELD3"] = "" # Will store False
> rec["SOMEFIELD3"] = chr(32) # Will store False
> rec["SOMEFIELD3"] = chr(0) # Will store False
> rec.store()
> 
> Strange thing: if I do not set the value of a numeric field, it becomes 
> NULL. The same thing I cannot do for logical fields: if I do not set the 
> value of a logical field, it becomes an invalid value, denoted with a 
> question mark.
> 
> Any ideas?
> 
> Thanks,
> 
>    Laszlo



More information about the Python-list mailing list