var adCmdText="&H0001";
var adInteger=3;
var adParamInput="&H0001";
//上述的三个变量在操作系统目录下(%systemroot%/system32/adovbs.inc),vb中导入即可,如下句:
<%-- --%>(该语句已注释)
function IncreaseClicks(id)
{
var conn = new ActiveXObject("ADODB.Connection");
var cmd = new ActiveXObject("ADODB.Command");//必须注册组件scrrun.dll,(msxml3.dll 或许不用)(regsvr32 scrrun.dll )
var connstr="DRIVER={SQL Server};server=127.0.0.1;database=ttldb;uid=ttl;pwd=ttldbpwd;";
conn.Open(connstr);
cmd.ActiveConnection = conn;
cmd.CommandType = adCmdText;//adovbs.inc中的adCmdText值为&H0001
cmd.CommandText= "update Tb_FlashFile set FF_Clicks=FF_Clicks+1 where FF_Id=?";
cmd.Parameters.Append(cmd.CreateParameter("@FF_Id" , adInteger, adParamInput, 4, id));
cmd.Execute();
conn.close();
}
原文件如下:
opus.aspx
<%@ Page Language="C#" AutoEventWireup="true" Inherits="opus" CodeFile="opus.aspx.cs" %>
<%@ Register TagPrefix="cc1" Namespace="LtpPageControl" Assembly="LtpPageControl" %>
var adCmdText="&H0001";
var adInteger=3;
var adParamInput="&H0001";
//上述的三个变量在操作系统目录下(%systemroot%/system32/adovbs.inc),vb中导入即可,如下句:
<%-- --%>(该语句已注释)
function IncreaseClicks(id)
{
var conn = new ActiveXObject("ADODB.Connection");
var cmd = new ActiveXObject("ADODB.Command");//必须注册组件scrrun.dll,(msxml3.dll 或许不用)(regsvr32 scrrun.dll )
var connstr="DRIVER={SQL Server};server=127.0.0.1;database=ttldb;uid=ttl;pwd=ttldbpwd;";
conn.Open(connstr);
cmd.ActiveConnection = conn;
cmd.CommandType = adCmdText;//adovbs.inc中的adCmdText值为&H0001
cmd.CommandText= "update Tb_FlashFile set FF_Clicks=FF_Clicks+1 where FF_Id=?";
cmd.Parameters.Append(cmd.CreateParameter("@FF_Id" , adInteger, adParamInput, 4, id));
cmd.Execute();
conn.close();
}