Monday, 26 January 2009

save1.asp code


<!--#include file="../../SQLconn.asp" -->

<% Response.Expires = 0 %>
<%
function IsNotNumeric(pStr, pDefaultValue)
dim sTemp
sTemp = pStr
if isNuLL(sTemp) OR sTemp = "" OR not isNumeric(sTemp) then
sTemp = pDefaultValue
end if
IsNotNumeric = sTemp
end function

function validText(pStr)
dim sTemp
sTemp = ""
if Not isNuLL(pStr) AND (pStr <> "") then
sTemp = Replace(pStr, "'", "''")
end if
validText = sTemp
end function

UserID__MMColParam = IsNotNumeric(Request("UI"),0)
name = Request("name")

Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = conn
Recordset1.Source = "UPDATE USERID SET Username = '"& validText(name) &"' WHERE UI = "& UserID__MMColParam
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0

%>
<%
conn.close
set conn=nothing
%>

No comments:

Post a Comment