|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用filesystemobject,可以对服务器上的文件进行操作,浏览、复制、移动、删除等。有ado的支持,asp对数据库的操作非常得心应手。你甚至可以像使用本地数据库那样,管理远程主机上的数据库,对表格、记录进行各种操作。数据|数据库<%
//查询办法
//----------------------------(1)-------------------------------
SetRsWorkUserInfo=Server.CreateObject("ADODB.RecordSet")
StrSql="SelectUsersId,LoginName,UserName,Password"
StrSql=StrSql&"FromUsers"
StrSql=StrSql&"WhereUsersId="&SqlStr(tUserID)
IfRsWorkUserInfo.State=1Then
RsWorkUserInfo.Close
EndIf
RsWorkUserInfo.OpenStrSql,Conn,1,1
IfNotRsWorkUserInfo.EofThen
LoginName=RsWorkUserInfo("LoginName")
UserName=RsWorkUserInfo("UserName")
Password=RsWorkUserInfo("Password")
Endif
RsWorkUserInfo.Close
SetRsWorkUserInfo=Nothing
//----------------------------(2)-------------------------------
StrSql="SelectUsersId,LoginName,UserName,Password"
StrSql=StrSql&"FromUsers"
StrSql=StrSql&"WhereUsersId="&SqlStr(tUserID)
SetRsFind=Conn.Execute(StrSql)
IfNotRsFind.EofThen
LoginName=RsFind("LoginName")
UserName=RsFind("UserName")
Password=RsFind("Password")
Endif
RsFind.Close
SetRsFind=Nothing
//修正办法
//----------------------------(1)-------------------------------
SetRsWorkUserInfo=Server.CreateObject("ADODB.RecordSet")
StrSql="SelectUsersId,LoginName,UserName,Password"
StrSql=StrSql&"FromUsers"
StrSql=StrSql&"WhereUsersId="&SqlStr(tUserID)
IfRsWorkUserInfo.State=1Then
RsWorkUserInfo.Close
EndIf
RsWorkUserInfo.OpenStrSql,Conn,1,3
IFNotRsWorkUserInfo.EofThen
RsWorkUserInfo("LoginName")=LoginName
RsWorkUserInfo("UserName")=UserName
RsWorkUserInfo("Password")=Md5(Password)
RsWorkUserInfo.Update
Update=True
Else
Update=False
Endif
RsWorkUserInfo.Close
SetRsWorkUserInfo=Nothing
//----------------------------(2)-------------------------------
StrSql="UpdateUsers"
StrSql=StrSql&"SetLoginName="&SqlStr(LoginName)&",UserName="&SqlStr(UserName)&",Password="&SqlStr(Password)
StrSql=StrSql&"WhereUsersId="&SqlStr(tUserID)
Conn.Execute(StrSql)
//增加办法
//----------------------------(1)-------------------------------
SetRsWorkUserInfo=Server.CreateObject("ADODB.RecordSet")
StrSql="SelectUsersId,LoginName,UserName,Password"
StrSql=StrSql&"FromUsers"
StrSql=StrSql&"WhereUsersId="&SqlStr(tUserID)
IfRsWorkUserInfo.State=1Then
RsWorkUserInfo.Close
EndIf
RsWorkUserInfo.OpenStrSql,Conn,1,3
IfRsWorkUserInfo.EofThen
RsWorkUserInfo.AddNew
RsWorkUserInfo("UsersID")=tUserId
RsWorkUserInfo("LoginName")=LoginName
RsWorkUserInfo("UserName")=UserName
RsWorkUserInfo("Password")=Md5(Password)
RsWorkUserInfo.Update
NewRecord=True
Else
NewRecord=False
Endif
RsWorkUserInfo.Close
SetRsWorkUserInfo=Nothing
//----------------------------(2)-------------------------------
StrSql="InsertIntoUsers(UsersId,LoginName,UserName,Password)"
StrSql=StrSql&"Values("&SqlStr(tUserID)&","&SqlStr(LoginName)&","&SqlStr(UserName)&","&SqlStr(Password)&")"
Conn.Execute(StrSql)
//删除办法
//----------------------------(1)-------------------------------
SetRsWorkUserInfo=Server.CreateObject("ADODB.RecordSet")
StrSq</p>减少客户内IT专业人才缺乏带来的影响。ASP的客户员工利用浏览器进入相关的应用软件,简单易用,无需专业技术支持。 |
|