Hello Karol,

 

to 1st:

Master: In this case I generate it with select max(nr)+1 from xxx where 
new.jahr… I know, not the best way.

Detail: NEW.ID = GEN_ID(TBESTPOS_ID_GEN, 1); (generator)

 

To 2nd: 

Both tables are linked to the firebird database over the firebird odbc driver. 
After I insert the master record and klick into the detail-form, I get the 
generated Nr back from firebird (before I insert a detail data set). I’m sorry, 
I don’t know how the driver works in detail.

 

Third:

After I insert the detail records (one or more) it looks good. But If I open 
the report (on Open event me.refresh in vba) then I see in some situations 
other records in my actually generated. After I close the Form and load it 
again, the last record is empty and in this before there are the detail records 
of the old and the new order. After I insert the detail records I get the ID 
directly back and see this..

 

Thanks for helping.

 

Best regards.

Olaf

Hi,

1. How you generate pk keys
2. Have you the same transaction for master detail
3. How you refresh data - you include in refresh query new ids?

Regards,
Karol Bieniaszewski

----- Reply message -----
Od: "checkmail" < <mailto:[email protected]> [email protected]>
Do: < <mailto:[email protected]> 
[email protected]>
Temat: [firebird-support] difficult question
Data: śr., gru 4, 2013 15:48


  

Hello,

 

today I have a quite difficult question. I have tested this situation with 
different versions of Microsoft Access, Firebird and Firebird-ODBC, in any case 
sometimes occurs a phenomenon.

 

The frontend is microsoft access, version 2002, 2003, 2007, 2010 and 2013 
testet. Firebird with version 2.0, 2.1 and 2.5 and the last odbc-drivers. 
Firebird runs in cs mode. Now I have a table with orders and a second table 
with orderpositions. The composite primary key from orders consists of jahr and 
nr, the orderpositions references with a foreign key to this table and its 
primary key is a continual ID.

 

In my Frontend there is a form with the orders and a sub-form with the 
positions – the data-side of both forms is connected over jahr and nr. Now I 
can create a order, in main-form I select a supplier and select some articles 
in my sub-form. Ideally – it works fine. But in some case (notably if in the 
order before it is the same supplier) I select one or more parts to order and 
If the form will refresh, the order-positions from the order before are in the 
actually order! If I close the form and reopen it again, the last 
orderpositions and in the order before there are the from the last order. The 
same situation I have with a different odbc-driver and some other versions of 
Access. I’m confused and the problem exists for some years! One from 50 orders 
goes wrong in this way, the same problem exists in some other areas (inquire…)

 

What can it be? In the most cases it works fine, but why not in every? 

 

Thank you very much.

 

Best regards

 

Olaf

 

 



Reply via email to