Laszlo Nagy 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 F
On 23/05/2009 12:32 AM, Laszlo Nagy wrote:
dbfpy is very old code.
Try setting up a CHAR(1) field and filling it with "Y" or "N" or
"T" or "F".. indicating yes,no,true or false...
Unfortunately, my task is to import records into a database that is used
by an old foxpro program. I'm not
dbfpy is very old code.
Try setting up a CHAR(1) field and filling it with "Y" or "N" or
"T" or "F".. indicating yes,no,true or false...
Unfortunately, my task is to import records into a database that is used
by an old foxpro program. I'm not allowed to change the database
structure i
On Fri, 22 May 2009 08:34:17 +0200, Laszlo Nagy
wrote:
> Now I also tried to set -1. In any of the above cases, if I open that
> dbf file with a commercial DBF editor application then I see that the
> value is not null.
>
> - Borland Database Desktop shows "False" value
> - CDBF shows an invali
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["SOMEFIELD
On May 22, 1:53 am, Laszlo Nagy 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["SOM
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
wrote:
> Here is the next problem. For boolean/logical fields, I can set their
> value to True/False easily. However,
Laszlo Nagy 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 F
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
Laszlo Nagy wrote:
[snip]
I have never seen such a construct before. Index a tuple with a boolean???
self.stream = file(f, ("r+b", "rb")[bool(readOnly)])
Python originally didn't have Boolean; it used 0 for false and 1 for
true. When the Boolean class was added it was subclasse
David Lyon írta:
Hi,
Try not opening the file in append mode (no "a+")
Inside the logic, there is already a seek to the end of the file
and the record counters at the start of the file need updating
too.
The first thing I tried is to use a filename instead of the file object
but it didn't w
Hi,
Try not opening the file in append mode (no "a+")
Inside the logic, there is already a seek to the end of the file
and the record counters at the start of the file need updating
too.
Regards
David
On Thu, 21 May 2009 13:25:04 +0200, Laszlo Nagy
wrote:
> Given this example program:
>
>
Laszlo Nagy wrote:
Given this example program:
import dbfpy
def dbf_open(tblname):
fpath = os.path.join(local.DB_DIR,tblname)
f = file(fpath,"ab+")
f.seek(0)
tbl = dbf.Dbf(f)
return tbl
tbl = dbf_open("partners.dbf")
rec = tbl.newRecord()
rec["FIELDNAME1"] = 1
rec["FIELDNAME2"] =
Given this example program:
import dbfpy
def dbf_open(tblname):
fpath = os.path.join(local.DB_DIR,tblname)
f = file(fpath,"ab+")
f.seek(0)
tbl = dbf.Dbf(f)
return tbl
tbl = dbf_open("partners.dbf")
rec = tbl.newRecord()
rec["FIELDNAME1"] = 1
rec["FIELDNAME2"] = "Somebody"
rec.stor
14 matches
Mail list logo