1.7.0版本

快速入门

创建你的第一个ZeroASP程序。

1.7.0版本

基础模块1

核心基础通用类等。

1.7.0版本

基础模块2

核心基础通用类等。

1.7.0版本

数据操作模块

具备多种数据库的数据解决方案。

1.7.0版本

请求获取模块

包括GET,POST,数据流等等客户端数据。

1.7.0版本

图片/文件上传模块

支持原生表单,AJAX和Flash组件上传。

1.7.0版本

时间模块

具备多种时间处理方法。

1.7.0版本

加密模块

支持多种加密解密解决方案。

1.7.0版本

数据/文本流模块

不仅适用于上传支持,还适用于远程请求支持。

1.7.0版本

远程请求模块

API请求核心功能。

1.7.0版本

JSON模块

读写JSON数据,减少手动拼接带来的错误。

1.7.0版本

XML模块

读取XML数据和生成XML数据等方法。

1.7.0版本

FSO模块

文件夹和文件操作的增删查改方法。

1.7.0版本

自定义模块

方便开发者整合自己的功能方法。

1.7.0版本

字典模块

更令人满意的处理关联数据的解决方法。

1.7.0版本

邮件模块

采用CDO组件发送,支持SSL协议。

1.7.0版本

MVC模块

符合经典ASP3.0编程为基础的MVC。

1.7.0版本

二维码模块

生成二维码,保存二维码,二维码图片转换。

1.7.0版本

图片验证码模块

生成图片验证码,支持标准格式。

1.7.0版本

Excel模块

采用Excel组件导入导出,支持标准格式。

1.7.0版本

条形码模块

生成条形码,支持标准格式。

1.7.0版本

阿里云模块

支持阿里短信发送,支付宝支付核心等。

1.7.0版本

微信模块

支持微信消息,微信支付核心等。

数据操作(Zasp.DB.Function)

数据操作模块,作为ZeroASP的主要数据绑定来源,具备较多的数据解决方案,致力于方便各水平段的开发人员,你的数据会轻松地拥有丰富友好的操作体验。你可以免费将该模块使用于任何个人项目。但是不能去除模块信息。官方QQ群:199951855。


使用数据操作模块更新说明

  • 下载相应模块后,打开ZeroASP/Extend/文件夹路径,覆盖新版模块即可;

数据操作模块方法

Access():Access数据库引擎;

Access([参数1=数据库地址],[参数2=数据库密码],[参数3(可选)=JET/ACE])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Conn
			Set Conn = Zasp.DB.Access("./Data/ZeroASP.mdb","123456","JET")
			%>

Excel():Excel数据库引擎;

Excel([参数1=数据库地址],[参数2=数据库密码],[参数3(可选)=JET/ACE])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Conn
			Set Conn = Zasp.DB.Excel("./Data/ZeroASP.mdb","123456","JET")
			%>

MsSQL():MsSQL数据库引擎;

MsSQL([参数1=数据库名称],[参数2=数据库地址,本地数据库则为(local)],[参数3=账号],[参数4=密码],[参数5=端口号])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Conn
			Set Conn = Zasp.DB.MsSQL("ZeroASP","(local)","sa","123456","1433")
			%>

SQLite():SQLite数据库引擎;

SQLite([参数1=数据库地址])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Conn
			Set Conn = Zasp.DB.SQLite("./Data/ZeroASP.db")
			%>

MySQL():MySQL数据库引擎;

MySQL([参数1=数据库名称],[参数2=数据库地址,本地数据库则为localhost],[参数3=账号],[参数4=密码],[参数5=端口号])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Conn
			Set Conn = Zasp.DB.MySQL("ZeroASP","localhost","root","123456","3306")
			%>

Query():数据查询;

Query([参数1=数据库],[参数2=SQL语句])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			'单条查询
			Dim Res
			Set Res = Zasp.DB.Query(Conn,"Select * From [Table]")
			Zasp.Echo(Res("Title"))

			'循环查询(无分页)
			Dim Res
			Set Res = Zasp.DB.Query(Conn,"Select * From [Table]")
			Do While Not Res.Eof
				Zasp.Echo(Res("Title"))
			Res.MoveNext
			Loop

			'循环查询(数组存储带分页)
			Dim Topsum,Limit,Pager,URL,Res,Res2,SkipStart,SkipEnd,I
			'预处理参数:Topsum,Limit,Pager,URL
			Topsum = Zasp.DB.Load(1) '输出总条数,URL参数为top
			Limit = Zasp.DB.Load(2) '每页记录数,URL参数为limit
			Pager = Zasp.DB.Load(3) '当前页,URL参数为page
			URL = Zasp.DB.Load(4) 'URL地址,page参数需要在URL最后
			Set Res = Zasp.DB.Query(Conn,"Select Top " & Topsum & " * From [Table]")
			If Not Res.Eof Then
				Res2 = Res.GetRows()
				Set Res = Nothing
				SkipStart = Zasp.DB.List(Res2,1) '当前页数据开始位置
				SkipEnd = Zasp.DB.List(Res2,2) '当前页数据结束位置
				'以下为需要显示的内容(数据、样式等输出显示列)
				For I = SkipStart To SkipEnd
					Zasp.Echo(Res2(0,I))
				Next
				'显示分页
				Call Zasp.DB.Page(Zasp.DB.List(Res2,3),URL) '分页显示样式
				Set Res = Nothing
			Else
				Set Res = Nothing
			End If

			'循环查询(MySQL分页)
			Dim Res
			Set Res = Zasp.DB.Query(Conn,"Select * From `Table` Limit 0,10")
			Do While Not Res.Eof
				Zasp.Echo(Res("Title"))
			Res.MoveNext
			Loop
			%>

Rs():Recordset数据处理;

Rs([参数1=数据库],[参数2=SQL语句],[参数3=游标类型],[参数4=锁定类型])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Res
			Set Res = Zasp.DB.Rs(Conn,"Select * From [Table]",1,1)
			Do While Not Res.Eof
				Zasp.Echo(Res("Title"))
			Res.MoveNext
			Loop
			Set Res = Nothing
			%>

Exe():数据执行;

Exe([参数1=数据库],[参数2=SQL语句])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Call Zasp.DB.Exe(Conn,"Insert Into [Table] (Id,Title)Values('1','ZeroASP数据写入')")
			%>

ExeRows():数据执行并返回影响行数;

ExeRows([参数1=数据库],[参数2=SQL语句])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			Dim Line
			Line = Zasp.DB.ExeRows(Conn,"Insert Into [Table] (Id,Title)Values('1','ZeroASP数据写入')")
			Zasp.Echo("
共有" & Line & "行受到影响
") Line = 0 '释放返回行数 %>

Command():参数化;

Command([参数1(可选)=1添加/2删除/3查询/4修改],[参数2=数据库],[参数3=SQL语句],[参数4=条件],[参数5(可选)=AQ精确/FQ模糊])

			<!--#include file="./ZeroASP/ZeroASP.asp"-->
			<%
			'添加数据
			Dim Id,Explain,Data
			Id = Zasp.Base.RndN(10000000,99999999)
			Explain = "文本内容"
			Data = Zasp.DB.Parameters(Zasp.DB.Parameter(Id) & Zasp.DB.Parameter(Explain))
			Call Zasp.DB.Command(1,Conn,"Insert Into [Table] (Id,Explain)Values(?,?)",Data,"AQ,AQ")

			'删除数据
			Dim Id,Explain,Data
			Id = Zasp.Base.RndN(10000000,99999999)
			Explain = "文本内容"
			Data = Zasp.DB.Parameters(Zasp.DB.Parameter(Id) & Zasp.DB.Parameter(Explain))
			Call Zasp.DB.Command(2,Conn,"Delete * From [Table] Where Id=? And Explain=?",Data,"AQ,AQ")

			'查询数据
			Dim Id,Explain,Data,Res
			Id = Zasp.Base.RndN(10000000,99999999)
			Explain = "文本内容"
			Data = Zasp.DB.Parameters(Zasp.DB.Parameter(Id) & Zasp.DB.Parameter(Explain))
			Set Res = Zasp.DB.Command(3,Conn,"Select * From [Table] Where Id=? And Explain=?",Data,"AQ,AQ")
			Zasp.Echo(Res("Id"))

			'修改数据
			Dim Id,Explain,Explain_New,Data
			Id = Zasp.Base.RndN(10000000,99999999)
			Explain = "文本内容"
			Explain_New = "新文本内容"
			Data = Zasp.DB.Parameters(Zasp.DB.Parameter(Explain_New) & Zasp.DB.Parameter(Id) & Zasp.DB.Parameter(Explain))
			Call Zasp.DB.Command(4,Conn,"Update [Table] Set Explain=? Where Id=? And Explain=?",Data,"AQ,AQ,AQ")
			%>

注:
1.使用MySQL数据库,字段内容含有中文需使用Zasp.Base.Tounicode方法转码和Zasp.Base.Unicodeto方法解码;
2.使用MySQL数据库,表和字段均需要加反单引号【`】,例如:
Call Zasp.DB.Exe(Conn,"Insert Into `Table` (`Id`,`Title`)Values('1','ZeroASP数据写入')")。


了解更多 »

了解更多 »