Board index » delphi » Autoinc with dbExpress Problem

Autoinc with dbExpress Problem

Hi,

I'm using dbexpress with Firebird. I've defined correctly the generator
and the trigger for
generated this autoinc value  automatically.
I've tried to insert on the table with SQLCLientDataSet and with
SQLDataSet +DataSetProvider+
ClientDataSet but I always get the same error:

Field 'CODPUERTA' must be a value. CODPUERTA is my autoinc field.

Can someone help me? Thanks in advanced

Marta

Sorry by my english!

 

Re:Autoinc with dbExpress Problem


Set the Required property for the field object of the ClientDataSet to
False.

On Tue, 25 Jun 2002 18:03:09 +0200, Marta Vazquez <ma...@iranon.com>
wrote:

Quote
>Hi,

>I'm using dbexpress with Firebird. I've defined correctly the generator
>and the trigger for
>generated this autoinc value  automatically.
>I've tried to insert on the table with SQLCLientDataSet and with
>SQLDataSet +DataSetProvider+
>ClientDataSet but I always get the same error:

>Field 'CODPUERTA' must be a value. CODPUERTA is my autoinc field.

>Can someone help me? Thanks in advanced

>Marta

>Sorry by my english!

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Re:Autoinc with dbExpress Problem


The problem's got nothing to do with the trigger, but with the persistent
fields of your ClientDataSet. There's a "required" property in the fields,
just set it to false in your key fields (which I supposed to be your autoinc
field), and let the trigger do the job for you.

There's another solution: just let setted the "required" property to true,
and use any value in your autoinc field, 0, for instance. in anyway, the
field will get the trigger-generated value.

Rodrigo A. de Freitas
rafrei...@ajato.com.br

"Marta Vazquez" <ma...@iranon.com> escreveu na mensagem
news:3D18943D.7080802@iranon.com...

Quote
> Hi,

> I'm using dbexpress with Firebird. I've defined correctly the generator
> and the trigger for
> generated this autoinc value  automatically.
> I've tried to insert on the table with SQLCLientDataSet and with
> SQLDataSet +DataSetProvider+
> ClientDataSet but I always get the same error:

> Field 'CODPUERTA' must be a value. CODPUERTA is my autoinc field.

> Can someone help me? Thanks in advanced

> Marta

> Sorry by my english!

Re:Autoinc with dbExpress Problem


I set the required property for the field object to False but I get the
same error
"Field value required". If I asigned a value to the field the insert
work correctly, but
I've work with BDE and it isn't neccessary to do the previous assignement.
With dbExpress is it neccesary  assignement manually the autoinc?

Thanks in advanced

Bill Todd escribi::

Quote
>Set the Required property for the field object of the ClientDataSet to
>False.

>On Tue, 25 Jun 2002 18:03:09 +0200, Marta Vazquez <ma...@iranon.com>
>wrote:

>>Hi,

>>I'm using dbexpress with Firebird. I've defined correctly the generator
>>and the trigger for
>>generated this autoinc value  automatically.
>>I've tried to insert on the table with SQLCLientDataSet and with
>>SQLDataSet +DataSetProvider+
>>ClientDataSet but I always get the same error:

>>Field 'CODPUERTA' must be a value. CODPUERTA is my autoinc field.

>>Can someone help me? Thanks in advanced

>>Marta

>>Sorry by my english!

>--
>Bill (TeamB)
>(TeamB cannot respond to questions received via email)

Re:Autoinc with dbExpress Problem


Don't use TSQLClientDataSet. It has problems. Use

TSQLDataSet/TSQLQuery -> TDataSetProvider -> TClientDataSet

instead.

You may find this information on AutoInc fields useful:
http://community.borland.com/article/0,1410,20847,00.html

--
Dave Rowntree

Quote
"Marta Vazquez" <ma...@iranon.com> wrote in message

news:3D18943D.7080802@iranon.com...
Quote
> Hi,

> I'm using dbexpress with Firebird. I've defined correctly the generator
> and the trigger for
> generated this autoinc value  automatically.
> I've tried to insert on the table with SQLCLientDataSet and with
> SQLDataSet +DataSetProvider+
> ClientDataSet but I always get the same error:

> Field 'CODPUERTA' must be a value. CODPUERTA is my autoinc field.

> Can someone help me? Thanks in advanced

> Marta

> Sorry by my english!

Re:Autoinc with dbExpress Problem


I always assign the value in the client application but what you are
trying to do should work. The only things I can think of is that there
is something wrong with your trigger that is causing it not to assign
a value or there is some incompatibility between the dbExpress driver
and Firebird. Remember that the dbExpress driver is not tested against
Firebird. It is only tested against InterBase. You might post your
trigger so we can have a look at it. Also, make sure that your
provider's ResolveToDataSet property is set to false.

On Wed, 26 Jun 2002 09:36:48 +0200, Marta Vazquez <ma...@iranon.com>
wrote:

Quote
>I set the required property for the field object to False but I get the
>same error
>"Field value required". If I asigned a value to the field the insert
>work correctly, but
>I've work with BDE and it isn't neccessary to do the previous assignement.
>With dbExpress is it neccesary  assignement manually the autoinc?

>Thanks in advanced

>Bill Todd escribi::

>>Set the Required property for the field object of the ClientDataSet to
>>False.

>>On Tue, 25 Jun 2002 18:03:09 +0200, Marta Vazquez <ma...@iranon.com>
>>wrote:

>>>Hi,

>>>I'm using dbexpress with Firebird. I've defined correctly the generator
>>>and the trigger for
>>>generated this autoinc value  automatically.
>>>I've tried to insert on the table with SQLCLientDataSet and with
>>>SQLDataSet +DataSetProvider+
>>>ClientDataSet but I always get the same error:

>>>Field 'CODPUERTA' must be a value. CODPUERTA is my autoinc field.

>>>Can someone help me? Thanks in advanced

>>>Marta

>>>Sorry by my english!

>>--
>>Bill (TeamB)
>>(TeamB cannot respond to questions received via email)

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads