Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 4 of 4 total |
Update dataset when having a autoinc field |
Thu, Dec 3 2015 2:50 PM | Permanent Link |
Huseyin Aliz myBiss ApS | Hi All,
Can anyone see why following fails: Database.StartTransaction; try with Tasks do begin Columns['TaskID'].SortDirection:=sdAscending; SortCaseInsensitive:=True; Sort; InitFind; Columns['TaskID'].AsInteger:=9; if Find(False,True) then begin Tasks.Update; Tasks.Columns['Done'].AsBoolean:=True; Tasks.Save; end; end; Database.Commit; except Database.Rollback; raise; end; TaskID in dataset tasks are defined as autoinc in dbisam. It fails with: Database commit response error (cannot find the row for updating). It's version 2.03 B1. Thanks in advance, Regards, Hüseyin A. |
Thu, Dec 3 2015 7:24 PM | Permanent Link |
Richard Harding Wise Nutrition Coaching | Hi
The primary key is needed to locate the row. So, I suspect it means that: * a primary key is not defined on the table OR * the dataset is defined as a query and the base table is not defined OR * something else Richard |
Thu, Dec 3 2015 9:03 PM | Permanent Link |
Raul Team Elevate | On 12/3/2015 2:50 PM, Hüseyin Aliz wrote:
> Can anyone see why following fails: > TaskID in dataset tasks are defined as autoinc in dbisam. > It fails with: Database commit response error (cannot find the row for > updating). > It's version 2.03 B1. What Richard said - AutoInc field itself is not enough (it just means increasing integer). You also need a primary index. Sionce it's DBISAM esiest change is to alter table with dbsys and change the default primary index (one with blank name) to have the "TaskID" as the indexed field. Raul |
Fri, Dec 4 2015 3:34 AM | Permanent Link |
Huseyin Aliz myBiss ApS | Raul/Richard,
Thanks both. Altering table and setting taskid as primary key did fix the problem Regards, Hüseyin Den 04-12-2015 kl. 03:03 skrev Raul: > On 12/3/2015 2:50 PM, Hüseyin Aliz wrote: >> Can anyone see why following fails: >> TaskID in dataset tasks are defined as autoinc in dbisam. >> It fails with: Database commit response error (cannot find the row for >> updating). >> It's version 2.03 B1. > > > What Richard said - AutoInc field itself is not enough (it just means > increasing integer). > > You also need a primary index. > > Sionce it's DBISAM esiest change is to alter table with dbsys and > change the default primary index (one with blank name) to have the > "TaskID" as the indexed field. > > Raul |
This web page was last updated on Tuesday, December 10, 2024 at 04:57 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |