Versuchs mal so (mit Limitierung auf 3-mal falsche PW-Eingabe):
[autoit]#include "MySQL.au3"
[/autoit][autoit][/autoit][autoit]$susername = "root"
$sdatabase = "dcot"
$sserver = "localhost"
$sDriver = "{MySQL ODBC 5.1 Driver}"
$count = 0
Do
$count += 1
$spassword = InputBox("Passwort", "Bitte Passwort eingeben")
$sqlinstance = _mysqlconnect($susername, $spassword, $sdatabase, $sserver, $sDriver) ; Connect to SQL-Server
Until Not @error Or $count = 3
If $count = 3 Then
MsgBox(0, 'Fehler', 'Das Paßwort wurde 3-mal falsch eingegeben.' & @LF & 'Das Programm wird beendet.')
Exit
EndIf
; der weitere Programmcode
[/autoit]