developer155
Programmer
Hi I am using the following code to execute stored proc and get a recordset, but getting an error that recordset object is closed. Can someone please take a look if there is issue in code:
Thanks!!
<%
var CS_updateConnection = MM_mediakitDB_STRING;
Application("ConnectionProvider") = "MSDASQL";
Application("ConnectionString") = CS_updateConnection;
var Conn = Server.CreateObject("ADODB.Connection");
Conn.Provider = Application("ConnectionProvider");
Conn.Open(Application("ConnectionString"));
////////
var oCmd = Server.CreateObject("ADODB.Command");
oCmd.ActiveConnection = Conn;
oCmd.CommandText = "processAdLink";
oCmd.CommandType = 4;
var p = oCmd.Parameters;
p.Append (oCmd.CreateParameter("@adID",17))
oCmd("@adID") = adID;
var adInfo = Server.CreateObject("ADODB.Recordset")
adInfpen (oCmd)
if (!adInfo.EOF) { //Getting error here!!!
var goURL = String(adInfo("goURL"));
var winID = String(adInfo("winID"));
} else {
var adID="failed"
}
adInfo.Close
Conn.Close
%>
Thanks!!
<%
var CS_updateConnection = MM_mediakitDB_STRING;
Application("ConnectionProvider") = "MSDASQL";
Application("ConnectionString") = CS_updateConnection;
var Conn = Server.CreateObject("ADODB.Connection");
Conn.Provider = Application("ConnectionProvider");
Conn.Open(Application("ConnectionString"));
////////
var oCmd = Server.CreateObject("ADODB.Command");
oCmd.ActiveConnection = Conn;
oCmd.CommandText = "processAdLink";
oCmd.CommandType = 4;
var p = oCmd.Parameters;
p.Append (oCmd.CreateParameter("@adID",17))
oCmd("@adID") = adID;
var adInfo = Server.CreateObject("ADODB.Recordset")
adInfpen (oCmd)
if (!adInfo.EOF) { //Getting error here!!!
var goURL = String(adInfo("goURL"));
var winID = String(adInfo("winID"));
} else {
var adID="failed"
}
adInfo.Close
Conn.Close
%>