Results 1 to 10 of 10

Thread: Sub New Constructor probem? [Resolved}

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Sub New Constructor probem? [Resolved}

    Hi,

    In a project which seems to work O.K. I have designed forms which inherits from fclsAction.

    certain controls and code have been added to those derived forms and, subsequent to that, fclsAction has been amended.

    The project and the solution have been rebuilt.

    When I now attempt to view those derived forms in the design view, I am unable to do so and get the message

    "The ConnectionString property has not been properly initialised"

    I assume that this is something to do with the Public Sub New Constructor in the derived forms, yet they correspond exactly with the Sub New Constructor of the base class, as follows:

    VB Code:
    1. Public Sub New()
    2.         MyBase.New()
    3.  
    4.         'This call is required by the Windows Form Designer.
    5.         InitializeComponent()
    6.  
    7.         'Add any initialization after the InitializeComponent() call
    8.  
    9.     End Sub

    The connection is instanced in the general section of the Module as follows:

    VB Code:
    1. Public cnRankings As New OleDb.OleDbConnection

    and the connectionstring is set in a form which does not inherit from fclsAction, as follows:

    VB Code:
    1. Dim strDB1 As String
    2.         strDB1 = "Provider=Microsoft.Jet.oledb.4.0;data source =" & strDB
    3.         cnRankings.ConnectionString = strDB1
    4.         cnRankings.Open()

    StrDB contains the path & file selected in an OpenFileDialog box.

    Anyone have any suggestions please?
    Last edited by taxes; Feb 27th, 2004 at 05:09 PM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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