VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "HoloDB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Public zMGR_Connection As New ADODB.Connection
Public zMGR_Test As New ADODB.Connection
Public zMGR_Set As New ADODB.Recordset
Public zMGR_State As Boolean
Function checkConnection(serverHost As String, serverPort As Integer, serverDatabase As String, serverUsername As String, serverPassword As String) As Boolean
On Error Resume Next
zMGR_Test.Close
On Error GoTo errorConnection
zMGR_Test.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=" & serverHost & ";Port=" & serverPort & ";Database=" & serverDatabase & ";User=" & serverUsername & ";Password=" & serverPassword & ";Option=3;"
zMGR_Test.Open
zMGR_Test.Close
checkConnection = True
Exit Function
errorConnection:
checkConnection = False
End Function
Function openConnection(serverHost As String, serverPort As Integer, serverDatabase As String, serverUsername As String, serverPassword As String)
On Error GoTo errorConnection
zMGR_Connection.ConnectionString = "Driver={MySQL ODBC 3.51 Driver};Server=" & serverHost & ";Port=" & serverPort & ";Database=" & serverDatabase & ";User=" & serverUsername & ";Password=" & serverPassword & ";Option=3;"
zMGR_Connection.Open
zMGR_Set.ActiveConnection = zMGR_Connection
zMGR_State = True
Exit Function
errorConnection:
zMGR_State = False
End Function
Function closeConnection()
On Error Resume Next
zMGR_Connection.Close
zMGR_State = False
End Function
Function checkExists(Query) As Boolean
On Error Resume Next
If zMGR_State = True Then
    zMGR_Set.Open Query
    If zMGR_Set.EOF = False Then checkExists = True
    zMGR_Set.Close
End If
End Function
Function runQuery(Query As String)
On Error Resume Next
If zMGR_State = True Then
    zMGR_Connection.Execute Query
End If
End Function
Function runRead(Query As String) As String
On Error Resume Next
If zMGR_State = True Then
    zMGR_Set.Open Query
    If zMGR_Set.EOF = False Then
    MGR_TEMP = zMGR_Set.GetString
    runRead = Left(MGR_TEMP, Len(MGR_TEMP) - 1)
    End If
    zMGR_Set.Close
End If
End Function
