Linux中国  设为主页
 收藏本站
 
当前位置: > 首页 ->编程语言 ->ASP ->ASP函数库
  相关分类: 
ASP
ViualBasic
UML / Rational Rose
PHP4/PHP5
Perl
JAVA/JSP教程
Delphi
ColdFusion
CGI
C/C++
ASP.NET
XML
  站内搜索: 
热门文章排行
热门文章排行 ADO连接数据库字符串大全(04-23)
Asp教程:Response对象(04-23)
网站安全之ASP程序加密/解密方法大揭(04-23)
ASP函数库(05-31)
基于ASP的站内多值搜索(04-24)
精采文章排行
精采文章排行 从本质上看网页(asp,jsp)的编写(06-01)
学以致用 驳“ASP低能论” (06-01)
用VB构建Internet的应用(06-01)
Asp的安全管理(12)(06-01)
Windows 2000 安全性技术概述--3(06-01)
  ·学以致用 驳“ASP低能论” ·用VB构建Internet的应用·Asp的安全管理(12)·Windows 2000 安全性技术概述--3·Windows 2000 安全性技术概述--2·Windows 2000 安全性技术概述--1·ActiveX技术综述(二) ·ActiveX技术综述(一) ·动态网页技术--CGI:ASP:JSP:PHP(4)

ASP函数库

作者:Webmaster   来源:Linuxdby.com   点击:   日期:2007-05-31 [收藏] [投稿]

  IE是否经常中毒?推荐您


      If UCase(NeFilarry(1))="Z" Then templx="Int"
      If SqlType =1 Then
         def_kh_l="('"
         def_kh_r="')"
      End If
      If Trim(NeFilarry(3))<>"" Then templx=templx &" DEFAULT " & def_kh_l & Trim(NeFilarry(3)) & def_kh_r
      If ai<>UBound(filsarry) Then
         spfstr= spfstr & "[" & NeFilarry(0) & "] " & templx &","
      Else
         spfstr= spfstr & "[" & NeFilarry(0) & "] " & templx
      End If
  Next
  TempSqlStr="CREATE TABLE ["&Trim(Tabnamestr)&"] (" & spfstr & ")"
  set fu_Conn=server.createobject("ADODB.Connection")
  fu_Conn.open ConnStrs
  fu_Conn.Execute TempSqlStr
  fu_Conn.Close
  Set fu_Conn=Nothing
  If Err.Number = 0 Then
     CreatTable=True
  End If
  On Error GoTo 0
End Function
'**************************************************
'函数ID:0045[在数据库中插入字段值]
'函数名:InterTbValue
'作 用:创建数据表
'参 数:ConnStrs    ---- 数据库链接字串
'参 数:Tabnamestr  ---- 数据表名称
'参 数:CvArrstr    ---- 字段表 (写法: Fname1#Value|Fname2#Value|...) 最后一个不要写“|”
'参 数:SqlType     ---- Sql语句类型 (0 Access 1 Mssqlserver)
' Fname,Value 说明:字段名称,字段值
'返回值:如果插入成功返回 True 否则 False
'示 例:InterTbValue(basicDB(3),"cs","fa#t|fb#c|fc#n#")
'**************************************************
Public Function InterTbValue(ByVal ConnStrs,ByVal Tabnamestr,ByVal CvArrstr,ByVal SqlType)
  InterTbValue=False
  On Error GoTo 0
  On Error Resume Next
  Dim def_kh_l,def_kh_r,Filarray,Valuearray,Temparraya,Temparrayb,TempSqlStr1
  def_kh_l  =""
  def_kh_r  =""
  Temparraya=Split(CvArrstr,"|")
  For fai = LBound(Temparraya) To UBound(Temparraya)
      Temparrayb=Split(Temparraya(fai),"#")
      If (fai<> UBound(Temparraya)) Then
         Filarray  =Filarray & "[" & Temparrayb(0) & "],"
         Valuearray=Valuearray & "'" & Temparrayb(1) & "',"
      Else
         Filarray  =Filarray & "[" & Temparrayb(0) & "]"
         Valuearray=Valuearray & "'" & Temparrayb(1) & "'"
      End If
  Next
  TempSqlStr1="INSERT INTO [" & Tabnamestr & "] (" & Filarray & ") VALUES (" & Valuearray & ")"
  set fu1_Conn=server.createobject("ADODB.Connection")
  fu1_Conn.open ConnStrs
  fu1_Conn.Execute TempSqlStr1
  fu1_Conn.Close
  Set fu1_Conn=Nothing
  If Err.Number = 0 Then
     InterTbValue=True
  End If
  On Error GoTo 0
End Function
'**************************************************
'函数ID:0046[Cookie防乱码写入时用]
'函数名:CodeCookie
'作 用:Cookie防乱码写入时用
'参 数:str  ---- 字符串
'返回值:整理后的字符串
'示 例:
'**************************************************
Public Function CodeCookie(str)
  If isNumeric(str) Then str=Cstr(str)
  Dim newstr
  newstr=""
  For i=1 To Len(str)
      newstr=newstr & ascw(mid(str,i,1))
      If i<> Len(str) Then newstr= newstr & "a"
  Next
  CodeCookie=newstr
End Function
'**************************************************
'函数ID:0047[Cookie防乱码读出时用]
'函数名:DecodeCookie
'作 用:Cookie防乱码读出时用
'参 数:str  ---- 字符串
'返回值:整理后的字符串
'示 例:
'**************************************************
Public Function DecodeCookie(str)
  DecodeCookie=""
  Dim newstr
  newstr=Split(str,"a")
  For i = LBound(newstr) To UBound(newstr)
      DecodeCookie= DecodeCookie & chrw(newstr(i))
  Next
End Function
'**************************************************
'函数ID:0048[检测用户名和密码是否正确]
'函数名:DecodeCookie
'作 用:检测用户名和密码是否正确
'参 数:ConnStrs    ---- 数据库链接字串
'参 数:Tabnamestr  ---- 数据表名称
'参 数:Tumc        ---- 用户名称字段名称
'参 数:Cumc        ---- 用户名称

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<

上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2425 26 下一页

上一篇:SubSonic 的字段名未转义问题修正   下一篇:关于分页查询和性能问题
文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论

   相关文章:
·从本质上看网页(asp,jsp)的编写

   文章评论:(1条)
  
 请留名: 匿名评论   点击查看所有评论 论坛讨论
 

 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。