Free Newsletters:
DatabaseJournal  
DBANews
Database Journal
Search Database Journal:
 
MS SQL Oracle DB2 Access MySQL PostgreSQL PHP SQL Etc SQL Scripts & Samples Links Database Forum DBA Videos
internet.com

» Database Journal Home
» Database News
» DBA Videos
» Database Articles
» Database Tutorials
MS SQL
Oracle
MS Access
MySQL
DB2
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» DBA Jobs
» Sitemap

News Via RSS Feed



follow us on Twitter

Marketplace Partners
Be a Marketplace Partner




internet.commerce
Be a Commerce Partner


















A Year For Smarter Phones, Crowded Clouds

Hardware Vendors Face a Storm of Uncertainty

China Blocking NYTimes.com Access

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Database Journal | DBA Support | SQLCourse | SQLCourse2 | Swynk







Sr. Business Systems Analyst
Professional Technical Resources
US-WA-Seattle

Justtechjobs.com Post A Job | Post A Resume

Featured Database Articles

MS SQL

October 9, 2000

Utility to Build VB Class to Match SQL Stored Procedures

By Danny Lesandrini


What is SP2VB?

SP2VB (Stored Proc To VB Class) is a Visual Basic utility that will create the class module code necessary to execute SQL Server Stored Procs with an ADO Command object. In addition to preparing the necessary ADO calls, the utility uses the SQLDMO and SQLNS libraries to query your SQL Server for the names and parameters of all the Stored Procs in your database.


Why the Need for this Utility?

  • I hate to type!
  • I make mistakes when I type!
  • Typing long lists of parameters is boring!

What more need be said?

Executing a SQL Server Stored Proc from MS Access or from an ASP page is relatively trivial, but either way, you have to deal with the sometimes long list of input and output parameters. Even when parameters are few, you still want to keep your code consistent accross your entire application, employing a common naming scheme and including at least simple error handling.

Boring? Sometimes! But very necessary and always beneficial.

Accordingly, I came up with a plan to automate the task -- a simple code generator. The pages that follow will explain (at relatively high level) what the utility does and how you might modify the code to meet your specific needs. As usual, the source code is available for download so that you can test out the utility and adapt it as you please.

Before we get into the code itself, here's a screen shot of the main form. When we are finished, the tool will be able to perform the following functions:

  1. Connect to any SQL Server Database
  2. Optionally filter out System Stored Procs (Prefixed with dt_ or sp_)
  3. Optionally process only one user-specified procedure
  4. Assign the Data Type that the Function returns (Long or ADO Recordset)
  5. Display results so user can cut and paste into VB Class module

Future enhancements to this utility could include the following

  1. Automatically output results to VB Class Module
  2. Generate corresponding ASP Class Method execution code
  3. Automatically determine proper Data Type for Function return value


Page 2: Code the Utility


Go to page: 1  2  3  4  Next  

Tools:
Add databasejournal.com to your favorites
Add databasejournal.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed

MS SQL Archives







Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
save execution plan jimguy999 2 December 22nd, 07:53 AM
Copy Record and duplicate to a new table 02119 0 December 22nd, 06:15 AM
merging 2 rows into 1 row taffer 0 December 17th, 12:28 PM
Linked Server 2005 error connecting to Unidata anam 10 December 11th, 09:29 AM








internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers