TeraData SP returning back closed record set


TeraData SP returning back closed record set


I am trying to execute a Teradata SP which returns back a record set. BTEQ shows that the result Result Set correctly.

I am trying to emulate the same using MS ADO Command Object.

I am able to fire the SP correctly on Teradata server, but the result set returned back through ADO command object is a closed Record Set and hence un-usable to fetch the information returned back.

Following is the code snippet:

connStr = "Provider=MSDASQL;Driver{Teradata};DBCName=;UID=;PWD=";

connObj = new ActiveXObject("ADODB.Connection");
connObj.Connectionstring = connStr;

cmdObj = new ActiveXObject("ADODB.Command");
cmdObj.ActiveConnection = connObj;
cmdObj.CommandText = "CALL MyDB.sp_fetch_info(userid);";
cmdObj.Prepared = true;

recSet = null;
recSet = cmdObj.Execute();

if (recSet)
WScript.Echo("Record Set State: " + recSet.State);

Can somebody please let me know what could be the problem?

Devil Head