Results 1 to 10 of 10

Thread: VB.Net - Database Build wizard

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    VB.Net - Database Build wizard

    There are a number of components to this application...I am adding them one at a a time to this thread and explaining each in turn....

    Purpose:
    The database build wizard allows you to extract objects from a database (tbales, users, views, groups etc.) and save them as seperate script files or as a .Net resources file which can be run into a traget database using an installer.
    The wizard is designed to be extensible so that it can work with any database platform (once you write a data schema component for that database). I have written data schema providors for SybaseXI and SQL Server (also works with MSDE).

    Part 1 : The data schema base
    This describes the functionality that is required by the data schema providors. This is done as a set of MustInherit classes....
    Attached Files Attached Files

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: VB.Net - Database Build wizard

    Part 2: The Sybase data schema providor
    This implements the data schema base for a Sybase XI database.

    Part 3: The SQL serverdata schema providor
    This implements the data schema base for a SQL Server database.

    These are the meat of the application, containing logic to extract the SQL for creating objects (tables, users, views, user groups etc.) for the two database platforms.
    Attached Files Attached Files

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: VB.Net - Database Build wizard

    Part 4 : The database build wizard
    This is the main application.
    It consists of a single form using the excellent "wizard" control from www.divil.co.uk

    Using this you select a data schema providor (from the drop down list) and fill in the ODBC connection string.
    In step 2 you select the objects (users, tables, views etc...) that you want to extract from the checked list
    In step 3 you specify the output location and whether you want the output to be scripts or a resource file.
    Attached Files Attached Files

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: VB.Net - Database Build wizard

    To use this, compile up the first three components and copy the dlls to the \bin directory in the application.

    Any issues or suggestions for improvement, let me know...

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: VB.Net - Database Build wizard

    Hmmmm, odd. I can't compile the first project.... tells me that it can't find the "DataSchemaBase.snk" file??

    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??? *

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: VB.Net - Database Build wizard

    Ah - in all the projects you need to change the file AssemblyInfo.vb

    It has a line like:-
    VB Code:
    1. <Assembly: AssemblyKeyFile("DataSchemabase.snk")>

    Add the path to the file in your machine..i.e. if the project is in c:\my projects\vbforums\DataSchemaBase it should be changed to:

    VB Code:
    1. <Assembly: AssemblyKeyFile("c:\my projects\vbforums\DataSchemaBase\DataSchemaBase.snk")>

    This is a known issue with Visual Studio.

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: VB.Net - Database Build wizard

    Ok, got it to compile. It's now telling me that my ODBC connection string isn't valid. I've back track it to this point in the SQLServerDatasource.vb project:
    VB Code:
    1. Public Overrides WriteOnly Property ConnectionString() As String
    2.         Set(ByVal Value As String)
    3.             If SQLServerDatasource.TraceSettings.TraceInfo Then
    4.                 Trace.WriteLine("SQLServerDatasource.ConnectionString = " & Value, Me.GetType.ToString)
    5.             End If
    6.  
    7.             try
    8.                 _dbconn = New OleDb.OleDbConnection(Value)
    9.             catch e as exception
    10.  
    11.             end try
    12.         End Set
    13.     End Property

    Value is set correctly, but _dbconn is still nothing. Even "e" is nothing which would indicate that all was OK. Something else that stands out is that try...catch..end try isn't capitalizing nore does intellisense work any where in the vb file. I could really use this on a project that I'm working on, and would like to get it going. Uh... using SQL Server 2000 (local), Win XP, SQL Server auth. Any clues?

    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??? *

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: VB.Net - Database Build wizard

    Your ODBC string needs to be something like:-
    Code:
    Provider=SQLOLEDB;Persist Security Info=False;Integrated Security=SSPI;database=MyDatabase;server=(local);Connect Timeout=60
    Naturally change MyDatabase to the name of the database you are connecting to.

  9. #9
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: VB.Net - Database Build wizard

    Quote Originally Posted by Merrion
    Your ODBC string needs to be something like:-
    Code:
    Provider=SQLOLEDB;Persist Security Info=False;Integrated Security=SSPI;database=MyDatabase;server=(local);Connect Timeout=60
    Naturally change MyDatabase to the name of the database you are connecting to.
    D'oh! I had {SQL Server} as the provider.... not oldeDB.... will give it a go. Thanks for all your help!

    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??? *

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: VB.Net - Database Build wizard

    code fix...
    The fields collection was not being output in the correct order. This is fixed.
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width