Now I'm getting an 'Access Violation'?
What does that mean.
It means you are accessing memory which either doesn't exist or attempting to write to memory that is read-only.
Do this, place a breakpoint on the line
for i := Low(Data) to High(Data) do begin
then step through the code using F8.
If you can step through that "for" loop a few times, place a breakpoint on the "end;" line that is right after the "for" loop then press F9, that will tell you if the "for" loop is executed successfully in its entirety.
Let me know what the result of doing that is.