CModuleControls.cls

 VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CModuleControls"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private m_strModule As String
Private m_Conn As ADODB.Connection

Private Sub Class_Initialize()
      
    Set m_Conn = New ADODB.Connection
    m_Conn.Open ConnectString
   
End Sub

Private Sub Class_Terminate()
    m_Conn.Close
    Set m_Conn = Nothing
End Sub

Public Property Get Module() As String
    Module = m_strModule
End Property

Public Property Let Module(ByVal vNewValue As String)
    m_strModule = vNewValue
End Property

Public Function GetModuleControls(ByVal intModule_ID As Integer) As ADODB.Recordset
   
    Dim rs As New ADODB.Recordset
    Dim strSQL As String
       
    'construct query string for recordset
    strSQL = "Select * from Module_Controls Where Module_ID=" & intModule_ID & " and Language_id=" & oLanguage.Language_Index & ";"
    'set up a recordset object for patient
    rs.ActiveConnection = m_Conn
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenStatic
    rs.LockType = adLockOptimistic
    rs.Open strSQL

    If rs.EOF Then
        Set GetModuleControls = Nothing
    Else
        Set GetModuleControls = rs
    End If
    Set rs.ActiveConnection = Nothing

End Function


Public Function GetModuleTabControls(ByVal intModule_ID As Integer) As ADODB.Recordset
   
    Dim rs As New ADODB.Recordset
    Dim strSQL As String
       
    'construct query string for recordset
    strSQL = "Select * from Module_Tab_Controls Where Module_ID=" & intModule_ID & " and Language_id=" & oLanguage.Language_Index & ";"
    'set up a recordset object for patient
    rs.ActiveConnection = m_Conn
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenStatic
    rs.LockType = adLockOptimistic
    rs.Open strSQL

    If rs.EOF Then
        Set GetModuleTabControls = Nothing
    Else
        Set GetModuleTabControls = rs
    End If
    Set rs.ActiveConnection = Nothing

End Function

Project Homepage: