Hello,

trying out a dTextBox with decimal values (which works without problems, thank 
you for the quick answers!) I hit a new snag:

SQLite database, one table, only the three fields mentioned in the UserSQL. 
The primary key in this case is of type CHAR(3) and is filled in manually in 
the application. No autoincrement, no setting by trigger. Application with 
three dTextBox instances for these three fields and buttons for navigating, 
New, Save, Cancel, Exit.

1. self.DefaultValues = None:

class BizNum(dabo.biz.dBizobj):
        def initProperties(self):
                self.DataSource = "numtest"
                self.KeyField = "idn"
                self.UserSQL = """SELECT idn, amount, remark FROM numtest"""
                self.DefaultValues = None
                self.DataStructure = (("idn", "C", True, "numtest", "idn"),
                ("amount", "N", False, "numtest", "amount"),
                ("remark", "C", False, "numtest", "remark"))

Button "New" fills in the idn field with "-1-", the two other fields 
with "<None>". I overwrite the "-1-" with a unique new value for the PK and 
enter a number into the "amount" field. Then I press "Save" and get this:

"Save Failed:

no such column: dabo-tmpKeyField
SQL: update "numtest" set "idn" = 'AC1', "amount" = 34.50, "remark" = 
NULL, "dabo-tmpKeyField" = NULL where "idn"='-1-dabotmp' "

2. Nothing set for self.DefaultValues:

Button "New" fills the idn field with "-1-" as before, the "amount" field 
with "0.00", the "remark" field stays empty. I enter values, press "Save". No 
error message, "Changes to all records saved" in the status line. I navigate 
in the data, the last record is the newly entered one. I close my application 
and start the sqlite command line client: no trace of the new record. 

3. self.DefaultValues = {"idn": "ZZZ", "remark": None}:

Now the idn field of a new record is filled with "ZZZ" If I change that value 
(which would be the normal procedure), the result is exactly the same as 
before (No. 2). If I let it unchanged (one record with primary key ZZZ would 
be possible), I get:

"Save Failed:

numtest.idn may not be NULL
SQL: insert into "numtest" ("amount", "remark") values (8999.33, NULL) "

4. self.AutoPopulatePK = false:

The idn field of a new record is now empty, but still "Changes to all records 
saved" and no new record in the database when I view it with the sqlite 
command line client (or if I close and restart my dabo application).

I can't find any way to get new records into the database. This seems to be a 
problem with manually entered primary keys, it doesn't happen with 
autoincrement PK fields. Will try this next with a Firebird database, because 
I really need this with one of my Firebird databases. 

What can I do?

Thank you,
Sibylle

-- 
Dr. Sibylle Koczian


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to