Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Master Detail Copy

Status
Not open for further replies.

cyberant

Programmer
Sep 21, 2003
44
ZA
Hey All

I'm having an issure with copying a master detail record.

I've got an Email table with a number of records and an Email_attachments table with a number of records with a master detail relationship to the Email table. I'm trying to put a foward capability within my program. In order to foward I want to make an exact copy of the record, the only obvious changed being the key fields.

I've tried various iteration routines but am still stuck. I've also got a OnNewRecord event that fires on the EmailAttachment query which takes the Email_ID (key field) value from the emails table so as to create the link between the two tables. This works fine until I have to go back on the emails table to the original email before I appendRecord it and thus can't assign the new email_id to my attachments.

If this makes any sense please help

Cheers

Ant
 
Have you thought about copying all of the fields to variables and then adding the master and detail records based on the variables?

-D
 
I've thought of this but it just seems a little clumsy, although I'm pretty sure that once the code is written and working I won't be worrying about the clumsyness of it. Do you have any idea how I would declare a variable that could hold BLOB data? Is there a specific variable or would I have to stream it to a TblobStream?

Cheers

Ant
 
What type of a blob is it? If it's a binary blob, yes, you'll have to use a TBlobStream. If it's a text blob, you may be able to get away with either a long string or a TStringList.

-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top