UniTable Issue Posting

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
johnbitner
Posts: 22
Joined: Thu 10 Sep 2009 16:18
Location: United States

UniTable Issue Posting

Post by johnbitner » Tue 15 Sep 2009 18:21

I have some code to directly use a table like this.

mytable.append;
mytable.fieldbyname('field1').aswidestring:= 'myvalue1';
mytable.fieldbyname('field2').aswidestring:= 'myvalue2';
mytable.fieldbyname('field3').aswidestring:= 'myvalue3';
mytable.post;

Using the UniTable this fails with the error "TBLID must have a value".

This happens when using the AccessProvider.

TBLID is the auto-number column for this table in the access version of my database. This code still works with the UniDAC SQLServerProvider with the MSSQL version of the database.

What am I missing here?

Thanks.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 17 Sep 2009 08:03

Currently Access provider cannot detect autoincrement fields. You can assing a value to TBLID manually or set the RequiredFields option of TUniQuery to False. In the second case posting will be successfull but the value generated in the database will not be assigned to the field of TUniTable.

We will try to add support for autoincrement fields in one of the next UniDAC versions.

Bob
Posts: 10
Joined: Thu 03 Jan 2008 21:18

Post by Bob » Wed 28 Apr 2010 13:50

I have several tables in access that have AUTONUMBER and no matter what I do, I cannot insert a record into any of the tables.

I get the error message - "Field 'ID' cannot be modified" (ID is the FTAutoInc Field in the table for this error)

Is their a status on when this will be supported. It is a show-stopper for me.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 30 Apr 2010 13:33

To solve the problem try to set the TUniTable.Options.SetFieldsReadOnly property to False.

Post Reply