[API]
mysql_initreal
mysql_closereal
mysql_real_connect
mysql_queryreal
mysql_store_result
mysql_free_result

[DEFINE]
Public MySQL_Handle As Long

[CODE]
Public Function MySQL_Init() As Boolean
  On Error Resume Next
  MySQL_Handle = mysql_initreal(0&)
  On Error GoTo 0
  MySQL_Init = Not (MySQL_Handle = 0&)
  End Function

Public Sub MySQL_Close()
  Call mysql_closereal(MySQL_Handle)
  End Sub

Public Function MySQL_Connect(ByVal Host As String, ByVal User As String, ByVal Password As String, Optional ByVal Database As String, Optional ByVal Port As Long) As Boolean
  If Port = 0& Then Port = 3306&
  If Not mysql_real_connect(MySQL_Handle, Host, User, Password, Database, Port, "NULL", 2&) = 0& Then
    Call mysql_queryreal(MySQL_Handle, "SET @@AUTOCOMMIT = 1")
    MySQL_Connect = True
    End If
  End Function
