OK, I have reproduced the problem.
Thank you for your patience.
The error here happens because
ADO issues a metadata discovery request which proved to be problematic.
We are actively working to improve this area in the next release of the
SQL Server to make it more robust.
As a workaround in VBScript you should be able to set ActiveConnection again like:
cn.BeginTrans
cmd.ActiveConnection = cn
cmd.CommandText = "test"
cmd.commandtype=4
cmd.Parameters.Refresh
cmd.Execute
cn.CommitTrans
cn.BeginTrans
cmd.ActiveConnection = cn
cmd.CommandText = "test"
cmd.commandtype=4
cmd.Parameters.Refresh
cmd.Execute
cn.CommitTrans
I suppose Delphi has an equivalent of setting active connection, could you try it?