Whenever I run pgexec(), my program always crashes the next time I run it or make any memory allocation. Something tells me that either that function or pqclear() is deleting an already deleted pointer...
Rob Stoddardrstodd(at)cts(dot)com