请各位多多帮忙,要出人命了!!!!!!!!!!!!!!!!!!!!!!!!
以下的一段代码要实现的目的是:如果在数据库NSXJserver.mdb表单member中有一名成员的生日与今天月日相同就弹出readtc.asp窗口,否则就不弹出,我不知这个条件如何加?????????????????????
<!--调用弹出窗口-->
<script language="JavaScript">
<!--
var gt = unescape('2');
var popup = null;
var over = "Launch Pop-up Navigator";
var flag = 0;
var tiannetDateNow=new Date();
var months=tiannetDateNow.getMonth()+1;
var days=tiannetDateNow.getDate();
var ctime=months+"-"+days;
function getCountFromDB() {
//以当前页面文件为基础,找到文件所在的绝对路径。
//var filePath = location.href.substring(0, location.href.indexOf("index.asp"));
//var path =filePath + "data#v390/NSXJserver.mdb";
var path = "D:/20080315/data#v390/NSXJserver.mdb";
//生成查询和更新用的sql语句。
var sqlSelCnt = "SELECT birthday FROM member ";
//建立连接,并生成相关字符串
var con = new ActiveXObject("ADODB.Connection");
con.Provider = "Microsoft.Jet.OLEDB.4.0";
con.ConnectionString = "Data Source=" + path;
con.open;
var rs = new ActiveXObject("ADODB.Recordset");
rs.open(sqlSelCnt, con);
while(!rs.eof) {
var cnt = rs.Fields("birthday");
var mm = cnt.getMonth() + 1; //获取成员生日的月份
var dd = cnt.getDay(); //获取成员生日的日
var cent =mm+"-"+dd
document.write(cent);
if (ctime==cent)
{
flag = 1;
}
rs.moveNext;
}
rs.close();
rs = null;
con.close();
con = null;
return flag;
}
getCountFromDB();
popup = window.open('', '', 'width=520,height=492,left=372,top=238,resizable=no,scrollbars=auto location=no');
if (popup != null && flag==1) {
//document.write(flag);
if (popup.opener == null) {
popup.opener = self;
}
popup.location.href = 'readtc.asp';
}
// -->
</script>