I use triggers when I'm using a live dataset but tend to do all my master/detail stuff 
with cached updates, so then use the generator in a stored procedure, getting the key 
value first so it can be used in child records etc. Same problem though, if the user 
cancels you waste a generator value... such is life. This all works just fine, just in 
this case it must be to do with that fact my lookup field is populated from the same 
table that I'm inserting into.

Like I say, I get the error but the insert is still successful.

Thanks for your comments anyway.
Andrew

-----Original Message-----
From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, April 13, 1999 10:47 AM
To:     Multiple recipients of list delphi
Subject:        RE: [DUG]: RE: Record/Key Deleted



I tend not to use the generator from a trigger for this reason.  Also if
you have related child records you need to have the key value before you
add them and you can't do this if you don't know the value.

Instead, I call the generator from the client code first and then use it in
the master and child records.  Problem is, if the user cancels, you lose a
generator value as generators are not included in transactions.







Andrew Masters <[EMAIL PROTECTED]> on 13/04/99 11:19:58

Please respond to [EMAIL PROTECTED]

To:   Multiple recipients of list delphi <[EMAIL PROTECTED]>
cc:    (bcc: Peter Jones/Logistics&Information
      Technology/Christchurch/Foodstuffs)
Subject:  RE: [DUG]: RE: Record/Key Deleted




Yep, using Interbase. Yep again, the table in question has a trigger which
gets a PK from a generator.

Figured it was something to do with this but was hoping there was an SOP
for handling this situation.

Cheers
Andrew

-----Original Message-----
From:     [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent:     Tuesday, April 13, 1999 8:03 AM
To:  Multiple recipients of list delphi
Subject:  Re: [DUG]: RE: Record/Key Deleted



What's the database?  It's a server of some sort I'm guessing.

If this is the case then it's probably becuase the server has changed the
data in between the bde writing it and reading it back again after.  The
bde does this to ensure that the record made it to the server in one peice.
So, you probably have a trigger or an autoincrementing field or maybe some
defaults that you haven't specified values for.

If it's not a server then I don't know.






Andrew Masters <[EMAIL PROTECTED]> on 12/04/99 16:52:01

Please respond to [EMAIL PROTECTED]

To:   Multiple recipients of list delphi <[EMAIL PROTECTED]>
cc:    (bcc: Peter Jones/Logistics&Information
      Technology/Christchurch/Foodstuffs)
Subject:  [DUG]:  RE: Record/Key Deleted




Well it may not have been such a dumb question... no takers. A last gasp
help on this one.. any ideas ??, I still haven't sussed it.

-----Original Message-----
From:     Andrew Masters [SMTP:[EMAIL PROTECTED]]
Sent:     Friday, April 09, 1999 3:40 PM
To:  'Delphi Users Group List'
Subject:  Record/Key Deleted

Hi All,

Despite my gut feeling that this is a dumb Friday question......

I've got a simple dialog with 3 bound controls (DBLookup, DBMemo,
DBCheckBox) using a query with a live dataset. I simply do a query.post to
save it. For some reason when I do a post I get a "Record/Key deleted"
error, but only when I'm inserting a new record, not when editing. But the
insert still works ??

I've got loads of these types of dialogs and have never seen this error
before. Anyone know what it means ? The ONLY different thing going on here
is the DBLookup is populated from the same table I'm inserting/Editing with
a SELECT DISTINCT(FIELD1) FROM TABLE (ie. User can enter anything into
FIELD1 but can select from a list of unique values previously entered).

FYI, using D3, IB4.

Thanks
Andrew Masters
Clinical Solutions Ltd
Auckland, NZ
Ph: +64-9-476-0106
Fax: +64-9-476-0108
e: [EMAIL PROTECTED]


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz






---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz


(UUEncoded file named: att1.unk follows)
(Its format is: File type unknown )



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
 << File: att1.unk >> 

application/ms-tnef

Reply via email to