I am attempting to populate an array from a MS SQL table. I'm able to make a connection to the database, but I'm not sure I am loading the array correctly because the elements return as null. Does anyone know how to load an array from a table?? Thank you.
Below is my code:
<%
var contTparray = new Array();
var CmdJobTp = Server.CreateObject( "ADODB.Command" );
var Con = Server.CreateObject( "ADODB.Connection" );
Con.Open( Session("ConnectionString" ) ;
CmdJobTp.ActiveConnection = Con;
CmdJobTp.CommandText = "{call ddlbJobTp(?)}";
CmdJobTp.Parameters.Append( CmdJobTp.CreateParameter( "sMsg", adChar, adParamOutput, 255, "" ) );
var rsJobTp = CmdJobTp.Execute();
var liCount=rsJobTp.RecordCount
var i=0;
while (! rsJobTp.EOF)
{
contTparray = rsJobTp("conttp"
i++
rsJobTp.moveNext();
}
rsJobTp = null;
CmdJobTp = null;
Con.Close();
Con=null;
%>
Below is my code:
<%
var contTparray = new Array();
var CmdJobTp = Server.CreateObject( "ADODB.Command" );
var Con = Server.CreateObject( "ADODB.Connection" );
Con.Open( Session("ConnectionString" ) ;
CmdJobTp.ActiveConnection = Con;
CmdJobTp.CommandText = "{call ddlbJobTp(?)}";
CmdJobTp.Parameters.Append( CmdJobTp.CreateParameter( "sMsg", adChar, adParamOutput, 255, "" ) );
var rsJobTp = CmdJobTp.Execute();
var liCount=rsJobTp.RecordCount
var i=0;
while (! rsJobTp.EOF)
{
contTparray = rsJobTp("conttp"
i++
rsJobTp.moveNext();
}
rsJobTp = null;
CmdJobTp = null;
Con.Close();
Con=null;
%>