<%@language="javascript"%>
<%
var sVodID = Request.QueryString("vodid");
if (sVodID == "")
{
	Response.End();
}

// 连接数据库
var objConn = Server.CreateObject("ADODB.Connection");
var sDBUrl= Server.MapPath("data\\VODDt.mdb");
var sConn = "Provider=Microsoft.Jet.OleDb.4.0; Data Source="+sDBUrl;
objConn.Open(sConn);

// 获取数据
var objRs = Server.CreateObject("ADODB.RecordSet")
var sSql = "select a.vodname, b.* from vod a, vodfile b where a.id = " + sVodID + " and b.vodid=" + sVodID + " order by b.filename"

try
{
	objRs.Open(sSql, objConn, 1, 1);
}
catch(e)
{
	objConn.Close();
	Response.End();
}

// 返回值
var sRet = "";
if (objRs.RecordCount > 0)
{
while(!objRs.Eof)
{
sRet += "AddToList('"+objRs("vodname")+"','"+objRs("filename")+"','"+sVodID+"','"+objRs("id")+"','"+objRs("fileurl")+"');\n"
objRs.MoveNext();
}
	
}

objRs.Close();
objConn.Close();
sRet = escape(sRet)
Response.Write(sRet);
%>