Results 1 to 3 of 3

Thread: Adding an entry

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    4

    Question

    I have one question. How exactly do you add a .name to your list? (example: entries.name2 ="") It won't let me add a PUBLIC NAME AS STRING in any other place but my class. I'm working on a database (not in Mdb! All in VB!) and would appreciate any help anyone could give me.

    Thanks alot

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008
    if you are creating a Class you need to use a private variable and then use Property Let and Get - you might as well do it this way because even if you use a Public variable (which you shouldn't) it will create hidden Let and Get properties for you anyway.

    e.g.

    Private m_Name As String

    Public Property Get Name() As String
    Name = m_Name
    End Property

    Public Property Let Name(ByVal s_NewName As String)
    m_Name = s_NewName
    End Property

    Apart from that it is the variable name 'Name' that the compiler objects to. Change it to aName.

    What is it, exactly you are trying to achieve?

    Cheers,

    P.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    4

    Smile Thanks alot

    Thanks for your help. To answer to your question, I'm just trying to learn how to do all this database stuff. I'm just learning COM and Winsock to make my apps a bit more spicier along with API.

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