Depending on what SQL server you are trying to connect to. If it is mysql, then there is
MySQL++[
^]. If you want a generic solution that will work with all databases, then you will need to use ODBC. Every SQL implementation that I know of has a ODBC driver with a mostly standard interface.
The only OBCD code I have was written under contract, so cant be shared, but googleing something like
ODBC Sample[
^] would be a good place to start