Sorry about that - didn't notice you were closing the connection in the loop...

Remove that line - actually drop it below the Next statement...