C
Colin Mc Mahon
Hi all,
I currently use a class to interface with my databases, allowing me to
insert, update, delete and retrieve records from the database as methods of
the class.
I have now created a recordset class and want to in some way instantiate
this class via the database class i.e.
Set objDbase = New cDatabase
With objDbase
.Database = "/db/db.mdb"
.Connect
End With
........ other code ........
Set rsObj = New objDbase.Recordset
......... RS Manipulation methods in the cRecordset class
Set objDbase = Nothing
I have experimented with 'Property Set' Within the cDatabase class but to no
avail, as follows
Public Property Set Recordset (cRecordset)
Set i_rs = New cRecordset
End Property
Public Property Get Recordset ()
Set Recordset = i_rs
End Property
I confess to being a novice with 'Property Set' having never used it before,
and I can't seem to find any practical examples of it online. I know JScript
supports inheritance to a degree, but need to work with vbscript at the
moment.
BTW the idea behind all this is to be able to instantiate independant
pseudo-recordsets so they can be paginated/manipulated independantly. This
could not be done efficiently using the dbase class alone when it's instance
existed from beginning to end of a page, or another class. The reason I want
to do it as a property is so that each one can be individually referenced
instead of using a fixed internal variable in the dbase class for each rs
class, which would defeat the purpose of the rs class.
Hopefully that makes sense to someone out there! Any insight, information,
drection or advice on instantiating classes like this within a class in
classic asp/vbscript would be gratefully appreciated, even if it's to say
'that's not the way to go about it'!
Thanks in advance,
Colin
I currently use a class to interface with my databases, allowing me to
insert, update, delete and retrieve records from the database as methods of
the class.
I have now created a recordset class and want to in some way instantiate
this class via the database class i.e.
Set objDbase = New cDatabase
With objDbase
.Database = "/db/db.mdb"
.Connect
End With
........ other code ........
Set rsObj = New objDbase.Recordset
......... RS Manipulation methods in the cRecordset class
Set objDbase = Nothing
I have experimented with 'Property Set' Within the cDatabase class but to no
avail, as follows
Public Property Set Recordset (cRecordset)
Set i_rs = New cRecordset
End Property
Public Property Get Recordset ()
Set Recordset = i_rs
End Property
I confess to being a novice with 'Property Set' having never used it before,
and I can't seem to find any practical examples of it online. I know JScript
supports inheritance to a degree, but need to work with vbscript at the
moment.
BTW the idea behind all this is to be able to instantiate independant
pseudo-recordsets so they can be paginated/manipulated independantly. This
could not be done efficiently using the dbase class alone when it's instance
existed from beginning to end of a page, or another class. The reason I want
to do it as a property is so that each one can be individually referenced
instead of using a fixed internal variable in the dbase class for each rs
class, which would defeat the purpose of the rs class.
Hopefully that makes sense to someone out there! Any insight, information,
drection or advice on instantiating classes like this within a class in
classic asp/vbscript would be gratefully appreciated, even if it's to say
'that's not the way to go about it'!
Thanks in advance,
Colin