📄 liuyan.asp
字号:
<%
function LiuYan() {};
LiuYan.TianJia = function (biaoTi, liuYanRen, neiRong) {
if (biaoTi==null) throw new Error("缺少biaoTi参数");
if (!/^.{1,50}$/.test(biaoTi)) throw new Error("biaoTi参数错误");
if (liuYanRen==null) throw new Error("缺少liuYanRen参数");
if (!/^[a-zA-X0-9_]{1,16}$/.test(liuYanRen)) throw new Error("liuYanRen参数错误");
if (neiRong==null) throw new Error("缺少neiRong参数");
if (!/^.{1,1000}$/m.test(neiRong)) throw new Error("liuYanRen参数错误");
var connection;
var command;
connection = new ActiveXObject("ADODB.Connection");
connection.ConnectionString = Application("ConnectionString");
command = new ActiveXObject("ADODB.Command");
command.CommandText = "INSERT INTO LiuYan (biaoTi, liuYanRen, neiRong) VALUES (?, ?, ?);";
command.CommandType = 0x0001 || 0x00000080; // adCmdText + adExecuteNoRecords;
var prmBiaoTi = command.CreateParameter("prmBiaoTi", 8, 1, 50, biaoTi);
var prmLiuYanRen = command.CreateParameter("prmLiuYanRen", 8, 1, 16, liuYanRen);
var prmNeiRong = command.CreateParameter("prmNeiROng", 8, 1, 1000, new String(neiRong).replace(/\n/g,"<br>"));
command.Parameters.Append(prmBiaoTi);
command.Parameters.Append(prmLiuYanRen);
command.Parameters.Append(prmNeiRong);
try {
connection.Open();
command.ActiveConnection = connection;
command.Execute();
connection.Close();
} catch(e) {
if (connection.State != 0) connection.Close();
throw e;
//throw new Error("写入数据库错误");
}
};
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -