End Sub
''/// <summary>
''/// 删除信息
''/// </summary>
''/// <param name="">信息体</param>
Public Sub Delete(Id)
Dim parms,SQL
parms = Array(Id)
SQL = mycom.Format(SQL_04,parms)
Call myacc.ExecuteNonQuery(myacc.CONN_STRING,SQL)
End Sub
''/// <summary>
''/// 统计信息
''/// </summary>
''/// <param name="">信息体</param>
Public Function Count(WhereValue)
Dim parms,SQL,objRS
parms = Array(WhereValue)
SQL = mycom.Format(SQL_07,parms)
Set objRS = myacc.Recordset(myacc.CONN_STRING,SQL)
Count = objRS.RecordCount
End Function
''/// <summary>
''/// 根据条件列出所有信息(带有分页)
''/// </summary>
''/// <param name="PageSize">每页记录数</param>
''/// <param name="CurrentPage">页码</param>
''/// <param name="WhereValue">判断值</param>
''/// <param name="OrderValue">排序</param>
''/// <returns>返回objRS</returns>
Public Function FindByPage(PageSize,CurrentPage,WhereValue,OrderValue)
Dim parms,SQL,objRS
Dim s1
If CurrentPage="0" Then
s1 = PageSize & "|" + OrderValue & "|" & WhereValue
parms = Split(s1,"|")
SQL = mycom.Format(SQL_05,parms)
Else
s1 = PageSize & "|" & OrderValue & "|" + WhereValue & "|" & CurrentPage*PageSize
parms = Split(s1,"|")
SQL = mycom.Format(SQL_06,parms)
End If
Set objRS = myacc.ExecuteReader(myacc.CONN_STRING,SQL)
Set FindByPage = objRS
End Function
Private Sub Class_Initialize()
SQL_01 = "Select * From [Guest] Where Id = {0}"
SQL_02 = "Insert into [Guest] ([Content],[Re],[Addtime],[Ip]) values(''{0}'',''{1}'',''{2}'',''{3}'')"
SQL_03 = "Update [Guest] Set [Content]=''{1}'',[Re]=''{2}'',[Addtime]=''{3}'',[Ip]=''{4}'' Where Id = {0}"
SQL_04 = "Delete From [Guest] Where Id In ({0})"
SQL_05 = "Select Top {0} * From [Guest] Where Content Like ''%{2}%'' Order By {1} Desc,Id Desc"
SQL_06 = "Select Top {0} * From [Guest] Where Content L