ZTKey has not been assigned the address of a TKey variable therefore its value is nil (because it is a global variable) which when dereferenced produces an access violation.
Solution: assign an appropriate address to ZTKey before the "with ZTKey^ do" statement.
In slightly more detail, ZTKey is nil because globals are (normally) zeroed. If it were a local variable (i.e. on the stack) it would simply contain rubbisch, which might or might not be a valid address and would likely be far more difficult to faultfind.
I'd add that it's unusual and refreshing for somebody asking a question to post a complete and succint compilable example (although for completeness adding the FPC version etc. is always useful). Keep up the good work!
MarkMLl