short (but loaded) question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n8kindt
    New Member
    • Mar 2008
    • 221

    short (but loaded) question

    does anyone know how to execute MySQL functions using VBA(Visual Basic for Applications)? i will even settle for a raw .dll file and then i can figure the rest out for calling it from vba. i need to use the mysql_ping function but have not found a way to do this for my Microsoft Access project!

    thanks,
    Nate
  • n8kindt
    New Member
    • Mar 2008
    • 221

    #2
    figured it out... however my main problem still remains. regardless, when using vba (or visual basic, etc) there is a dll that can be downloaded HERE

    here's my code for anyone who might need it:
    Code:
    Public Sub Ping_MySQL()
    
    On Error GoTo PingError
     Set GCnn = New MYSQL_CONNECTION
        GCnn.OpenConnection "xx.xxx.xx.xx", "your db name", "your password", "user name"
        If GCnn.State = MY_CONN_OPEN Then
        GCnn.ping
        Debug.Print "connection successfully pinged " & Now()
        Else: Debug.Print "ping command unavailable"
        End If
    Set GCnn = Nothing
    Exit Sub
    PingError:
    Debug.Print "ping error"
    Exit Sub
    End Sub
    if u're using this code, don't forget to add the VBAMySQL.dll in your references

    Comment

    Working...