Nesler, Thomas J wrote: > From: [email protected] on behalf of Rob Kennedy > ... >> If you're sure the value has type TBar, then use a function-style type-cast: >> >> TBlobStream.Create(TBlobField(Table1.Fields[x]), bmRead) >> >> If you would like the program to confirm at run time that the value has >> the intended type, then use a checked type-cast: >> >> TBlobStream.Create(Table1.Fields[x] as TBlobField, bmRead) >> >> I recommend the latter. >> >> I also recommend giving your variables better names, such as SourceTable >> and DestTable, so nobody needs to remember whether 1 or 2 is the thing >> you're copying. > > Thanks for the suggestions!...:-) I was unable to use the second one but the > first one worked fine.
If you were unable to use the second one, then your code is wrong. I assume you got an "invalid type-cast" exception at run time. That's not just for show. Your program is telling you that something is wrong. Find out what kind of object is really there. (If you can't see it in the debugger, then simply display the object's ClassName function with ShowMessage.) -- Rob

