Calling Stored Procedures

In learning about the CommandText property of the Command object, you now know how to call stored procedures. You will now learn about some best practices for calling stored procedures.


Remember, stored procedures will run faster than similar SQL commands that are executed with the Execute method of the Command or Connection objects. This is because they are already compiled. Stored procedures also allow you to separate your SQL into organized structures, making it easier to read and maintain.

Besides calling the store procedure as a text string where you set the CommandType property to adCmdText, you can also set it to adCmdStoredProc, which tells your data store that you are calling a stored procedure. This results ...

Get Sams Teach Yourself Microsoft® Windows® DNA Programming in 21 Days now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.