JScript 模拟 ADO.NET 基本对象
来源:互联网 发布:杭州淘宝美工师培训 编辑:程序博客网 时间:2024/06/05 17:20
<%@ Language="JScript" CODEPAGE = "936" %>
<!-- METADATA TYPE="TypeLib" UUID="00000200-0000-0010-8000-00AA006D2EA4" -->
<%
/*
ADO.NET Module For ASP
Error:
err.name
err.message
err.description
*/
// OLEDBConnection Class
function OLEDBConnection(strConnection)
{
this.ConnectionString = strConnection;
this.Connection = Server.CreateObject("ADODB.Connection");
this.Connection.ConnectionString = this.ConnectionString;
this.Open = function()
{
try {
this.Connection.ConnectionString = this.ConnectionString;
this.Connection.Open();
} catch(err) {
err.name = "Connection Open Error"
Debug(err);
}
}
this.Close = function()
{
try {
this.Connection.Close;
} catch(err) {
err.name = "Connection Close Error"
Debug(err);
}
}
// return this.Connection;
}
// OLEDBCommand Class
function OLEDBCommand(strCommandText, objConnection)
{
this.CommandText = strCommandText;
this.Connection = objConnection;
this.Command = Server.CreateObject("ADODB.Command");
this.Command.CommandType = 8; // adCmdUnknown
this.Command.CommandText = this.CommandText;
this.ExecuteReader = function()
{
try {
this.Command.CommandText = this.CommandText;
this.Command.ActiveConnection = this.Connection.Connection;
return this.Command.Execute;
} catch(err) {
err.name = "ExecuteReader Error"
Debug(err);
}
}
this.ExecuteNonQuery = function()
{
try {
this.Command.ActiveConnection = this.Connection;
this.Command.Execute;
} catch(err) {
err.name = "ExecuteNonQuery Error"
Debug(err);
}
}
// prototype: Parameters
this.Parameters = function(strParametersName,strParametersValue)
{
this.Parameters.Name = strParametersName;
this.Parameters.Value = strParametersValue;
if ((this.Parameters.Name) && (this.Parameters.Value)) {
this.Command.Parameters(this.Parameters.Name) = this.Parameters.Value;
}
}
// prototype: AddParameters
this.CreateParameters = function(strParametersName, intParametersType, intParametersDirection, intParametersSize, strParametersValue)
{
this.Parameters.Name = strParametersName;
this.Parameters.Type = intParametersType;
this.Parameters.Direction = intParametersDirection;
this.Parameters.Size = intParametersSize;
this.Parameters.Value = strParametersValue;
this.Command.Parameters.Append(this.Command.CreateParameter(this.Parameters.Name, this.Parameters.Type, this.Parameters.Direction, this.Parameters.Size, this.Parameters.Value));
}
function Debug(err)
{
Response.Write (err.name);
Response.Write ("<br>")
Response.Write (err.description);
Response.End
}
// return this.Command
}
%>
- JScript 模拟 ADO.NET 基本对象
- ADO.NET基本对象
- ADO.NET对象DataTable基本用法详解
- ADO.NET基本类
- ADO.NET对象模型
- ADO.NET对象模型
- ADO.NET对象模型
- ADO.NET对象模型
- ADO.NET数据对象
- ADO.NET--Connection对象
- ADO.NET--Command对象
- ADO.NET --DataReader对象
- ADO.NET -- DataSet对象
- ADO.NET --DataAdapter对象
- ADO.NET常用对象
- ADO.NET对象模型
- ADO.NET对象模型
- ADO.NET 对象介绍
- C++ SDK和Symbian开发入门之工具
- 关于/**/注释段在SQLPlus Worksheet中的问题(2004.12.15随笔)
- 今天MS Windowos XP 打了四只补丁!!
- 用Delphi在2000和XP/2003下从Ring3进入Ring0的无驱动解决方法
- 如何给rmvb加字幕
- JScript 模拟 ADO.NET 基本对象
- 如何成为一名黑客!
- [ZT]asp函数大全
- 飘浮广告显示脚本类(VBS,JS双版)
- XML 文件中出现 & ? ? 这类特殊字符的一种解决方法
- API函数声明
- 自由自在的给上传图片打水印
- 上大人孔乙己
- Microsoft Data Access Components (MDAC) 2.8