Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Does anyone know of any good books on ...

Author  Topic 

KarinsDad
Starting Member

17 Posts

Posted - 2002-04-02 : 12:31:38
ADO with C++ (not VB)

Sql Server Stored Procedures

Transact Sql

DTS

I'm trying to write a generic database class with a method (or methods) that basically accepts the name of a stored procedure along with a structure of parameters. It then goes off and parses the structure correctly, passing the parameters to the stored procedure, potentially getting back a recordset which it might store in some collection object.

When instantiated, the database object is passed a list of the stored procedures that the caller might need. The database object goes to a special table in the database which has the parameter list and parsing instructions for each of the stored procedures for it to handle.

The idea here is to not have a class for each and every table in the database, rather to have one semi-intelligent class. Hence, if you add a new table to the database and/or add a new DLL to the application (our application accepts dynamic DLLs), the DLL can instantiate the database class, passing it the names of new stored procedures, and the database object can just automatically handle it without any code changes to itself.


However, although I can get basic select ado recordset code to work, the MSDN documentation is somewhat limited with regard to Execute and stored procedure parameter passing.

So, if anyone knows of any good books out there, specifically with regard to ADO and Visual C++, I'd appreciate it.

PS. I'm using Visual Studio 6.0 and Sql Server 7.0.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-02 : 13:07:48
I have to laugh (not at you, at the situation), because whenever I really need a code example for VB/ADO, EVERY one of the examples in the ADO documentation is written in C++!

Wrox would be my first guess for having a book on this (http://www.wrox.com), but unfortunately I couldn't find a C++/ADO specific book. The ADO books that they have I'm sure have SOME C++ code examples, but they don't have examples on building custom classes using ADO.

Wrox would also be my first choice for a DTS book, they have a few and generally speaking you can't go wrong with a Wrox book. You can also try Rob Vieria's SQL Server Programming books, they're very very good.

But (oh boy, you knew this was gonna happen!) if you want the absolute best book on SQL Server stored procedures then look no farther than:

The Guru's Guide to SQL Server Stored Procedures, XML, and HTML

For T-SQL, get:

The Guru's Guide to Transact-SQL

Both of these are by Ken Henderson, and there are none better on their respective subjects. Don't take my word for it either, read the reviews on Amazon.com through the SQL Team Bookstore. If you want good discounts on Wrox books, check out [url]http://www.bookpool.com[/url]. Bookpool also had a special on Microsoft Press books last week, it might still be possible to pick up some discounts.

Go to Top of Page

KarinsDad
Starting Member

17 Posts

Posted - 2002-04-02 : 13:30:46
Interesting.

Except for the C++ examples in the ADO Samples section, virtually every technicle article and periodical I've read has VB type examples.

And, of course, most examples set up a query. They then turn around in article after article recommending compiled stored procedures instead of queries. Sigh.

As for the Guru's Guides, thanks for letting me know. They were at the top of my own research for SQL programming books, but it's good to have an independent confirmation.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-02 : 14:02:40
quote:
Except for the C++ examples in the ADO Samples section, virtually every technicle article and periodical I've read has VB type examples.

That's true, I should've said that. The web sites are almost all VB and nowadays, C# too.
quote:
And, of course, most examples set up a query. They then turn around in article after article recommending compiled stored procedures instead of queries. Sigh.

They're there to demonstrate how to use ADO for certain things. SQL Server and its methodologies were around long before ADO came out. It's better to know many ways of doing something, even if you don't use it. There are some rare occasions when stored procedures aren't always the best performers, or other circumstances that prevent their use (web/database hosts that give you a SQL Server database, but not CREATE PROC permissions...there used to be a number of these) At least you can still develop an ADO application.

Go to Top of Page
   

- Advertisement -