I'm currently reading the Active Server Page Bible book and in it I'm ready about how to create the Object Library
HERE'S WHAT I'VE BEEN ABLE TO TYPE SO FAR
But the book fails to instruct me on where to place these objects
The name for this code (from the book) is called Init and Save Methods for Group Object[/u]
I have no clue what this is or where it goes. Please explain if possible. Thanks
Public Sub Init(forum As Variant, Optional lngid As logn = -1)
Set m_dcndb = forum
m_blnisnew = (lngid = -1)
If Not m_blnisnew Then
Set m_rsdata = m_dcndb.Execute("select * from tblgroups " _
& "where groupid = " & logid)
FillObject Me, m_rsdata
m_rsdata.Close
End If
End Sub
Public Sub save()
'This method puts the object's data back into
'the database. This method could use the Insert
'statement or a stored procedure, if desired.
Dim objfield As ADODB.Field
Set m_rsdata = New ADODB.Recordset
If m_blnisnew Then
m_rsdata.Open "select * from tblGroups", _
m_dcndb, _
adOpenDynamic, _
adLockOptimistic
m_rsdata.AddNew
Else
m_rsdata.Open "select * from tblGroups" _
& "where groupid = " & m_lnggroupid, _
m_dcndb, _
adOpenDynamic, _
adLockPessimistic
End If
SaveObject Me, m_rsdata
m_rsdata.Update
'Calling FillObject here allows
'the unique id to be picked up in case
'of an addition.
FillObject Me, m_rsdata
m_rsdata.Close
End Sub
"The reward of one duty done is the power to fulfill another"
<%
Jr Clown
%>
HERE'S WHAT I'VE BEEN ABLE TO TYPE SO FAR
But the book fails to instruct me on where to place these objects
The name for this code (from the book) is called Init and Save Methods for Group Object[/u]
I have no clue what this is or where it goes. Please explain if possible. Thanks
Public Sub Init(forum As Variant, Optional lngid As logn = -1)
Set m_dcndb = forum
m_blnisnew = (lngid = -1)
If Not m_blnisnew Then
Set m_rsdata = m_dcndb.Execute("select * from tblgroups " _
& "where groupid = " & logid)
FillObject Me, m_rsdata
m_rsdata.Close
End If
End Sub
Public Sub save()
'This method puts the object's data back into
'the database. This method could use the Insert
'statement or a stored procedure, if desired.
Dim objfield As ADODB.Field
Set m_rsdata = New ADODB.Recordset
If m_blnisnew Then
m_rsdata.Open "select * from tblGroups", _
m_dcndb, _
adOpenDynamic, _
adLockOptimistic
m_rsdata.AddNew
Else
m_rsdata.Open "select * from tblGroups" _
& "where groupid = " & m_lnggroupid, _
m_dcndb, _
adOpenDynamic, _
adLockPessimistic
End If
SaveObject Me, m_rsdata
m_rsdata.Update
'Calling FillObject here allows
'the unique id to be picked up in case
'of an addition.
FillObject Me, m_rsdata
m_rsdata.Close
End Sub
"The reward of one duty done is the power to fulfill another"
<%
Jr Clown
%>