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 ---- 用户名称