Jump to content
Sign in to follow this  

Get message from SELECT on a MySQL DB using ADO API

Recommended Posts


Hi all,

when executing SQL statements on a mySQL server console directly, you get a return that looks somewhat like this:


How do I get that last row into a variable when executing queries in AutoIt?

I am using the ADO API.

This would especially be useful if I'm doing an UPDATE, to see how much rows are affected.

I've tried passing a variable as a second argument to the Execute method as described here, but this does not seem to work.

Global $Return, $Conn

$Conn = _IRIS_SQLConnect("myhost", "mydatabase", "myuser", "mypass")
$Conn.Execute("update active_users set username='testtest'", $return)

MsgBox(0, "", $Return)

Func _SQLConnect($ps_Server, $ps_DB, $ps_User, $ps_Pass)
    Local $lo_Connection = ObjCreate("ADODB.Connection")
    $lo_Connection.open ("DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & $ps_Server & ";DATABASE=" & $ps_DB & ";UID=" & $ps_User & ";PWD=" & $ps_Pass & ";PORT=3306")
    If @error Then Return 0
    Return $lo_Connection

I'm getting an empty MessageBox.

Any ideas?

Edited by Radiance

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.