CConsultationPatientHistory.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 = "CConsultationPatientHistory"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"

Private m_Conn As ADODB.Connection
Private m_strCNP As String

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 Function GetConsultations(ByVal dtDateFrom As Date, ByVal dtDateTo As Date, rs As ADODB.Recordset) As Boolean

    Dim strSQL As String
       
    'construct query string for recordset
    strSQL = "Select * from Consultations Where CNP='" & m_strCNP & "'"
    strSQL = strSQL & " and Consult_Date Between #" & ConvertDate2String(dtDateFrom) & "# and #" & ConvertDate2String(dtDateTo) & "# "
    strSQL = strSQL & " Order By Consult_Date Asc;"
    '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
        GetConsultations = False
    Else
        GetConsultations = True
    End If
    Set rs.ActiveConnection = Nothing

End Function

Public Property Get CNP() As String
    CNP = m_strCNP
End Property

Public Property Let CNP(ByVal vNewValue As String)
    m_strCNP = vNewValue
End Property

Project Homepage: