VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "History"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

' the name of this module - used if there is an error
Const g_modName As String = "FMStocks_Ext.History"

Public Function GetHistory(ByVal Ticker As String) As ADODB.Recordset
    On Error GoTo errorHandler
    
    ' the recordset that will be returned
    Dim rs As ADODB.Recordset
    
    ' fmstocks database component
    Dim db As FMStocks_DB.DBHelper
    Set db = New FMStocks_DB.DBHelper
    
    Set GetHistory = db.RunSQLReturnRS("select * from History where Ticker = ?", _
                                        Array(mp("Ticker", adVarChar, 12, Ticker)))
    
    ' done using the fmstocks component
    Set db = Nothing
    
    Exit Function
        
errorHandler:
    Set db = Nothing
    Set rs = Nothing
    
    ' display the error
    RaiseError g_modName, "History"
End Function

