Output parameter of MySQL stored procedures via ADODB in MS Access (VBA) correct on one computer and random on another -
i have tried (nearly) isolate problem, lost.
i have ms access application uses adodb interface local mysql database. copied new computer, output parameters of stored procedures contain random value each time (if done via adodb). when executed in mysql workbench, output parameters correct.
here specs of 2 computers:
- old: windows 7 pro, office 2010 proplus, mysql odbc 5.3.4, mysql server 5.6.22 (all 64-bit; 32-bit odbc installed);
- new: windows 10 pro, office 2016 proplus, mysql odbc 5.3.6, mysql server 5.7.16 (all 64-bit, except ms office; 32-bit odbc installed).
to isolate problem, used following simple stored procedure:
create procedure `testit`( out itest int(11)) begin set itest = 123; end
and test ms access database containing following vba code (and reference microsoft activex data objects 6.1 library):
public function dbtestit() long dim dbconn adodb.connection dim dbcmd adodb.command 'open new connection set dbconn = new adodb.connection dbconn.connectionstring = "driver={mysql odbc 5.3 ansi driver};option=3;database=xxx;user=root;password=yyy;" dbconn.open 'execute new command set dbcmd = new adodb.command dbcmd set .activeconnection = dbconn .commandtimeout = 0 .commandtype = adcmdstoredproc .commandtext = "testit" .parameters.append dbcmd.createparameter("itest", adinteger, adparamoutput) .execute dbtestit = dbcmd.parameters.item(0).value end 'close connection dbconn.close end function
here test results:
- on old computer, dbtestit() returns 123;
- on new computer, dbtestit() returns random values (e.g. 51, 1936020585, 1);
- and if connect new computer mysql server on old computer (using server=192.168.1.x in connection string), returns 123 well;
- this tells me problem (only) in mysql server on new computer (right?);
- however, if connect old computer mysql server on new computer, returns 123!
so problem seems in combination of components on new computer, , why? , how test it?
anybody bright ideas?
to further locate cause of problem, downgraded mysql odbc driver 5.3.6 on new computer version 5.3.4 (which on old computer) and works! confirm indeed cause, upgraded version 5.3.6 again , failed again.
so looks mysql odbc driver 5.3.6 (released 8 months ago!) has problems handling output parameters (local) mysql server 5.7.16, maybe in combination adodb , windows 10.
so moment use 5.3.4 version , report bug mysql.
Comments
Post a Comment