I want to create a component with objects that will represent records in a database table. Each object will represent a single record and expose a read-only property for each field.
Should I create a class module that opens a Recordset in its initialise event, make the initialise event use the primary key as a parameter and then create Property Get procedures for each field? OR should I create a class module that opens a Recordset each time an object is created, create the object with a method that uses a parameter for the primary key then create Property Get procedures for each field? Or are neither of these right?
Any help would be great.
Should I create a class module that opens a Recordset in its initialise event, make the initialise event use the primary key as a parameter and then create Property Get procedures for each field? OR should I create a class module that opens a Recordset each time an object is created, create the object with a method that uses a parameter for the primary key then create Property Get procedures for each field? Or are neither of these right?
Any help would be great.