script language="javascript" runat="server">
//用 JavaScript 写服务器端连接数据库的代码示例
var conn = new ActiveXObject("ADODB.Connection");
conn.Open("Provider=SQLOLEDB.1; Data Source=localhost; User ID=sa; "
+"Password=password; Initial Catalog=meizz");
var rs = new ActiveXObject("ADODB.Recordset");
var sql="select user_kind from tbRightSet where user_id='"+ Account +"'";
rs.open(sql, conn);
if (!rs.EOF)
{
sysUserKind = (rs("user_kind")+"").replace(/^\s+|\s+$/, "");
}
rs.close(); rs = null; conn.close(); conn = null;
//用 JavaScript 写服务器端连接数据库的代码示例
var conn = new ActiveXObject("ADODB.Connection");
conn.Open("Provider=SQLOLEDB.1; Data Source=localhost; User ID=sa; "
+"Password=password; Initial Catalog=meizz");
var rs = new ActiveXObject("ADODB.Recordset");
var sql="select user_kind from tbRightSet where user_id='"+ Account +"'";
rs.open(sql, conn);
if (!rs.EOF)
{
sysUserKind = (rs("user_kind")+"").replace(/^\s+|\s+$/, "");
}
rs.close(); rs = null; conn.close(); conn = null;
</script>
本文转自灵动生活博客园博客,原文链接:http://www.cnblogs.com/ywqu/archive/2008/10/07/1305604.html,如需转载请自行联系原作者