Strange error message with Oracle

The Oracle ODBC driver threw an error message on a completely innocent looking line:
SQLEXEC( m.lnHandle, ;
"BEGIN MyFunction('val1', ?pcVal2 ); END;" ;
)


ORA-06550: line 2, column 39: 
PLS-00103: Encountered the symbol "end-of-file" when
expecting one of the following:

( - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string liter (6550)

Even more puzzling is that the statement executes just fine on a second identically configured connection. The ODBC trace didn't reveal any particular useful. Both connections produce the same output up to the point where one returns with an error, but the other not.
By logging all network traffic with Ethereal it became at least apparent why Oracle throws the strange error message. The working version was transmitted as:
BEGIN MyFunction('val1', ?); END;

Oracle received the failing version like this
 BEGIN MyFunction('val1', 

In other words, starting with the query parameter, everything was missing. The ODBC driver simply didn't pass the entire query string on to the server. No wonder it was confused! The reason seems to be that somehow the Oracle ODBC driver couldn't keep track of the parameter bindings. The solution, therefore, is to add more occurrences of the query parameter like this:
DECLARE
X CHAR(10);
BEGIN
X:= ?pcVal2;
MyFunction('val1', ?pcVal2 );
END;