Subject Re: [IBO] Problem with insert
Author Erik Mlakar
The users can insert records through TIB_Grid or through TIB_Edit + TIBLookUpCombo + TIB_Edit

IB_QueryNewRecord code is very simple:
IB_DataSet.FieldByName('AUTONOM').AsInteger:= DataModul.GenerateAutoNumber('TEAMS.AUTONOM', 'TEAMS','') +1;

This statment is in IB_Query for insert.
INSERT INTO TEAMS (
AUTONOM, /*PK*/
TEAMNOM ,
TEAMNAME)
VALUES (
:AUTONOM,
:TEAMNOM ,
:TEAMNAME)

There in no other code in the program wich could be relevant to my insert.

Svein Erling Tysvaer <svein.erling.tysvaer@...> wrote: How do you insert the records, Erik? Through an IB_Grid? What does the
code for your IB_QueryNewRecord look like and are there any other code
that could be relevant when you insert?

Set

Erik Mlakar wrote:
> I am using IB_Query, IB_Datasourse, IB_Connection, IB_Transaction
>
> TABLE IN Firebird is
>
> CREATE TABLE TEAMS (
> AUTONOM INTEGER NOT NULL,
> TEAMNOM INTEGER NOT NULL,
> TEAMNAME VARCHAR(40) NOT NULL;
> ALTER TABLE EKIPE ADD PRIMARY KEY (AUTONOM);
>
> When a simple query in program. Here everting is ok. I not using
> trigger to determinate wich AutoNom is next, but I am using my own
> avtoinciment function witch work very good and it is set on
> IB_QueryNewRecord.
>
> SELECT
> TEAM. AUTONOM,
> TEAM. TEAMNOM,
> TEAM. TEAMNAME
> FROM
> TEAM
> WHERE (1=1)
>
> Problem is next:
>
> IF i have query like
>
> SELECT
> TEAM. AUTONOM,
> TEAM. TEAMNOM,
> TEAM. TEAMNAME
> FROM
> TEAM
> WHERE (1=1) And (TEAM. AUTONOM >= 1 and TEAM.AUTONOM <= 1)
>
> And I am trying to insert values (5, 1, 'PRO TEAM'), the values are
> all correct but when i post the query. Values disapear from the grid
> wich is correct. Then I am going to look the record in the base and it
> isn't there , but there is a record wich have values ('-3242343453',
> Null, Null').
>
> What is here wrong?





---------------------------------
Try the all-new Yahoo! Mail . "The New Version is radically easier to use" – The Wall Street Journal

[Non-text portions of this message have been removed]