Smoke this – Execute Parameterized Stored Procs with less code.

Okay so it turns out it’s all about performance (read my previous post) not forcing VB6 developers in ADO to set command parameter attributes like size and type, meant an additional round trip to the database. I don’t have a problem with MS taking this functionality out for the default but they could have allowed us a way to turn it back on.


Fear not I a have written a class that will go off to the database fetch all the attributes of the parameters in your query so that all you have to do is specify the values. WARNING: This will slow things down two trips to the database are slower than one, the only way I can see you could remove some of this overhead would be come up with a caching scheme.


I have tried to comment the code so you should find it fairly straghtforward to use, I have only tried using it on SQL Server 2000 so far. The source is attached to this post for your dining pleasure.

SQL.zip (1.51 KB)

One thought on “Smoke this – Execute Parameterized Stored Procs with less code.”

  1. Hi, thanks for your post on stored procedures, however your project is in .net and not VB6 although your post mentions VB6 and I was interested in a VB6 solution that’s why the search engine directed me to your page.

    Do you have any VB6 code?

Comments are closed.