Can anyone tell me .when in let property why we put parameter
of property always value type .why not return type should
be reference type.Additional can anyone explain me datasource
class of vb6.How should i use this data source class using ADO 2.6
Means using recordset object in a datasource class.any help would
be highly appreciated.

public Property Set XSupplier(ByVal vData As  Supplier) if it object type then why not reference type ?
   Set m_Sup = vData
   txtSupplierName.Text = m_Sup.SupName
   TxtSupid.Text = m_Sup.Supid
   TxtContactPerSon.Text = m_Sup.ContactPerson
   TxtOfficeaddress.Text = m_Sup.OfficeAddress
   TxtFaxNo.Text = m_Sup.FaxNo
   
End Property

Hi,

When we are using the class module then we have to create objects for that class. Each object has the property. The Property can be created by Let, Set and Get.

To know more about the Property Let, Set and Get look into the attached file.

Have a Good Day
Shailaja :)


Can anyone tell me .when in let property why we put parameter
of property always value type .why not return type should
be reference type.Additional can anyone explain me datasource
class of vb6.How should i use this data source class using ADO 2.6
Means using recordset object in a datasource class.any help would
be highly appreciated.

public Property Set XSupplier(ByVal vData As  Supplier) if it object type then why not reference type ?
   Set m_Sup = vData
   txtSupplierName.Text = m_Sup.SupName
   TxtSupid.Text = m_Sup.Supid
   TxtContactPerSon.Text = m_Sup.ContactPerson
   TxtOfficeaddress.Text = m_Sup.OfficeAddress
   TxtFaxNo.Text = m_Sup.FaxNo
   
End Property

Know i understand .let property is just like storage bucket where
data are assigned only.and with the help of get property we
read the variable value.that is why it is get.in the following case
Supname will return string type variable.since it is get.
and in a let propery m_ssupname will keep the value return from
vdata .kindly let me know .i am wright or wrong ?additioanal can you explain complex data consumer class and data source class.
i am simple want to implement a recordset using data source class.

Public Property Let SupName(ByVal vData As String)
    m_sSupName = vData
End Property


Public Property Get SupName() As String
[B]    SupName = m_sSupName  [/B]'this will return only string value.
End Property

When you declare/pass an arguement to any sub/function you need to declare the type (as string, integer, recordset)

From what I am looking at it seems that you are trying to pass the recordset object named suppliers... i.e.

Dim Suppliers As ADODB.Recordset
'....

Public Sub MySub(ByRef MyArg As Suppliers) '<this will error as there is no global/public object defined as suppliers, error should be user defined type not defined.

At least that is what it looks like to me that you are doing.

As for using a class to set the properties of objects on a form you just may want to skip it. A class (at least from the way it looks like you are using it) is for holding data. What you may want to do is to create a sub withing the form and just pass the recordset object to it to set the text of your text boxes.

Now, if I have this wrong, when then... nevermind (in meek voice)


Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.