Results 1 to 4 of 4

Thread: OOP Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Posts
    68

    OOP Question

    How can I used the object called babs and use one of its properties in the class it is delcared from. Specificlly I am calling the Connect method and I need the underlying function to use the _datastoreType that was setup up for this object. _datastoreType is a place holder for the Enum type DataStoreTypes which I have created. Could I pass the object itself and how would I go about passing the object or could the class work on the properties that have already been set for the object. Please post any code ideas you may have.

    PS: I am working on creating a generic Data Access Layer any comments or ideas are greatly apprecatied.

    Thanks




    Dim babs As New DAL_Properties()
    babs.Connect()


    Public Class DAL_Properties


    #Region "EnumDataStoreType"

    Public Enum DataStoreTypes
    SQLServer = 1
    Access = 2
    Flatfile = 3
    UNDEFINED = 4
    End Enum

    #End Region


    #Region "Private Properties"

    Private _databaseName As String
    Private _dataSourceName As String
    Private _userName As String
    Private _password As String
    Private _connectionString As String
    Private _command As String
    Private _datastoreType As DataStoreTypes

    #End Region

    #Region "Public Methods"

    Public Function Connect()

    Select Case

    Case SqlServer

    Case Access

    end select
    End Function
    Attached Files Attached Files

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I didn't understand the question, what is it you are asking again?

    For an object to call its own method it would either just use the name or Me.Property.

  3. #3
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Microsoft already has a data access layer - why re-create the wheel? Check out application blocks.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by VBCrazyCoder
    Microsoft already has a data access layer - why re-create the wheel? Check out application blocks.
    and the link : http://msdn.microsoft.com/library/de...ml/daab-rm.asp

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