Stored Procedure to VB code generator?-VBForums
Results 1 to 8 of 8

Thread: Stored Procedure to VB code generator?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    533

    Stored Procedure to VB code generator?

    Hello,

    does anybody have an info?

    Looking for tool commercial or open source, to create vb module or class code, from sql server (2008 R2 and newer) stored procedures.

    There exists one tool SP2VB by Danny Lesandrini, but it does not work nowadays as SQL Namespace objects are missing from the all MS redistributable packages.
    www.databasejournal.com/features/mssql/article.php/1494191/Utility-to-Build-VB-Class-to-Match-SQL-Stored-Procedures.htm

    Application references SQLDMO and SQLNamespace object libraries.

    Code:
    Reference= 10010001-E260-11CF-AE68-00AA004A34D5    8.0   SQLDMO.DLL Microsoft SQLDMO Object Library
    Reference= 00026F30-EB1C-11CF-AE6E-00AA004A34D5    7.0      sqlns.RLL Microsoft SQLNamespace Object Library

    SQLDMO is installed and referenced ok by downloading SQL Server 2005 Backward Compatibility Components, but it seems that the SQLNamespace is not included any of the MS packages anymore. I don't dare to try to install SQL2000 version MSDE components either.

  2. #2
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    397

    Re: Stored Procedure to VB code generator?

    Perhaps you can replace all SQLDMO functions with the system stored procedures (the names start with xp_ and sp_).
    Last edited by dreammanor; Sep 14th, 2017 at 08:08 AM.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,008

    Re: Stored Procedure to VB code generator?

    Quote Originally Posted by dreammanor View Post
    Perhaps you can replace all SQLDMO functions with the system stored procedures (the names start with xp_ and sp_).
    That's not the same thing... SQLDMO provides functionality beyond just system sprocs... the DMO stands for Database Management Object ... it provides access to things like being able to enumerate SQL Servers on the network, Attach/Detach databases, Backup/Restore, creating & executing SSIS Packages, Maintenance plans... all sorts of things you can't just simply replace with a stored proc. So sadly, it's just not that simple.

    Let me clarify that... what I just stated was a blanket statement... I guess in this case the functionality of SQLDMO could be replaced by the use of some system sprocs and a few other clever tricks. Hmmm....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    533

    Re: Stored Procedure to VB code generator?

    One (maybe most convenient) option is to rewrite SP2VB app procedure parser. Extract procedures from database to separate sql files and read/parse them to vb code without SQLDMO objects.

  5. #5

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    533

    Re: Stored Procedure to VB code generator?

    Yes, that is known, but it seems that SMO has managed code callable objects only.

  7. #7
    Frenzied Member gibra's Avatar
    Join Date
    Oct 2009
    Location
    ITALY
    Posts
    1,370

    Re: Stored Procedure to VB code generator?

    You can try to search and download the

    • Microsoft SQL Server XXX Backward Compatibility Components


    where XXXX is the your SQL Server version, example:

    for SQL Server 2005
    https://www.microsoft.com/en-us/down....aspx?id=24793
    for SQL Server 2008
    https://www.microsoft.com/en-us/down...s.aspx?id=6375

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    533

    Re: Stored Procedure to VB code generator?

    2008 version is .net only and do not contain namespace objects either.

    Backward Compatibility Components packs (included in feature pack) do contain SQL-DMO, but no namespace objects and it is the Microsoft SQL Server 2005 Backward Compatibility Components installer msi which has SQL-DMO.
    Last edited by Tech99; Sep 14th, 2017 at 01:38 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.