Guest_imported
New member
- Jan 1, 1970
- 0
Hello, can anyone please check whether the following code is correct? It seem to be that it is not working.
<%
if (Request.Form ("submit" <> "" Then
Dim adoCon, adoRec ' ADO connection object
Dim ConnString
Dim myNameID, myUserID, myPwd, myDept, myYr, myEmail, sql
myNameID = Request.Form ("text1"
myUserID = Request.Form ("text2"
myPwd = Request.Form ("password1"
myDept = Request.Form ("select1"
myYr = Request.Form ("select10"
myEmail= Request.Form ("text3"
Set adoCon = Server.CreateObject("ADODB.Connection"
Set adoRec=server.CreateObject ("ADODB.Recordset"
ConnString="driver={sql server};server=Mell; database=portal;DSN=localserver;PWD=;UID=sa;"
adoCon.Open ConnString
adoRec.ActiveConnection = adoCon
sql= " UPDATE info " & _
"SET NameID='" & myNameID & "', " & _
"UserID='" & myUserID & "', " & _
"password='" & myPwd & "', " & _
"yearinfo='" & myYr & "', " & _
"email='" & myEmail & "', " & _
"WHERE department='" & myDept & "'"
adoCon.Execute (sql)
Response.Redirect ("Continue"
else%>
<script>
window.alert("Records cannot be updated"
</script>
<%End if
adoCon.Close
Set adoCon = Nothing
%>
thank You!! :-V
<%
if (Request.Form ("submit" <> "" Then
Dim adoCon, adoRec ' ADO connection object
Dim ConnString
Dim myNameID, myUserID, myPwd, myDept, myYr, myEmail, sql
myNameID = Request.Form ("text1"
myUserID = Request.Form ("text2"
myPwd = Request.Form ("password1"
myDept = Request.Form ("select1"
myYr = Request.Form ("select10"
myEmail= Request.Form ("text3"
Set adoCon = Server.CreateObject("ADODB.Connection"
Set adoRec=server.CreateObject ("ADODB.Recordset"
ConnString="driver={sql server};server=Mell; database=portal;DSN=localserver;PWD=;UID=sa;"
adoCon.Open ConnString
adoRec.ActiveConnection = adoCon
sql= " UPDATE info " & _
"SET NameID='" & myNameID & "', " & _
"UserID='" & myUserID & "', " & _
"password='" & myPwd & "', " & _
"yearinfo='" & myYr & "', " & _
"email='" & myEmail & "', " & _
"WHERE department='" & myDept & "'"
adoCon.Execute (sql)
Response.Redirect ("Continue"
else%>
<script>
window.alert("Records cannot be updated"
</script>
<%End if
adoCon.Close
Set adoCon = Nothing
%>
thank You!! :-V