Quote:
> Couldn't you show me how to connect to MS SQL Server from VC++, create
> database, and execute some sql-query. I have a good book about SQL Server
> but it's not adhered to concrete programming language.
Then you may need a book with a more specific focus. :-(
There are a number of ways to go.
One way would have you program to the "native" API of SQL server. It has
been a while since I had to do this, but if I remember correctly that API
goes by the name of DBLIB. Go to the MSDN web site (msdn.microsoft.com) and
search for DB-Library.
Another way to go is to use the Open Database Connectivity (ODBC) API. ODBC
is a vendor neutral interface supplied by MS that is supplemented by a
"driver" provided by the database vendor. Check the docs for
SQLAllocEnv();
SQLAllocConnect();
SQLDriverConnect();
which are typically required by an ODBC client program to "attach" to a
database. Follow the links back to the overview of ODBC in the docs for
information on how you actually use ODBC to perform database operations
after connecting.
Finally, you might want to investigate higher level technologies like ADO,
RDO, OLEDB which are somewhat easier to use but further removed from the
details.
Regards,
Will