Sembra un bug irrisolto da MySQL ODBC e C/API
Una soluzione è eseguirlo utilizzando un comando SQL con variabili preparate:
Dim rs As ADODB.Recordset
Set cmd = New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandType = adCmdText
cmd.CommandText = "call InsertList(?,?,?,@fResult)"
cmd.Parameters.Append cmd.CreateParameter("fName", adVarChar, adParamInput, 20, Text3.Text)
cmd.Parameters.Append cmd.CreateParameter("fType", adVarChar, adParamInput, 3, Text2.Text)
cmd.Parameters.Append cmd.CreateParameter("fFood", adVarChar, adParamInput, 20, Text1.Text)
cmd.Execute
'And after that, using the same connection, get the value of
'@fResult from a single query:
Set rs = cn.Execute("select @fResult as fResult")
MsgBox rs!fResult
Otterrai il valore atteso.