Without seeing your program (attach it please), it's going to be hard to determine where and how you've gotten an invalid reference. I would suggest making a simple VI like I did with just a connect, get column information, and a disconnect. Once that works, you can start to debug the main VI and subVI. Fo that, you can single step through everything with probes on the references and other wires to see where the problem happens.
- how to use get column name.vi in SQL toolkit 2.0? sammi