First, you should read the "Before you make a query" thread BEFORE you make a query. That way you could put in your own code tags and I wouldn't have to be yo' mama and do it for you.

Secondly, I suspect your program is working, but the window is closing before you see the output. This is normal. If you want to see your output, either run the program in a command window, or put a breakpoint at the "return 0", or put a statement such as "getchar ();" immediately before the return 0.