Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hidden field. 1

Status
Not open for further replies.

arravalli12

Programmer
May 3, 2005
62
0
0
US
In my update application, I am passing nme as hidden field which is nothing but recordset of field name.
To make sure that update is not creating duplicate record, I created another recordset2.
<%
Dim Recordset2
Dim Recordset2_numRows
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_Agency_STRING
Recordset2.Source = "SELECT * FROM dbo.reports_downloads_request order by des"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()
while not Recordset2.eof and bolValid <> true
if Recordset2.Fields.Item("name").Value = nme then
bolValid = true
emsg(e) = "File description already exists. This record is not updated. Enter new File description"
e = e + 1
end if
Recordset2.MoveNext()
Wend
Recordset2.Close()
Set Recordset2 = Nothing
%>
This displays the error message correctly but when I change it to new file description, then my update statement does not get the hidden value nme.
Update statement works good if there are no error messages but once error occurs, my view source shows nme = "".
Doupdate.CommandText = "Update reports_downloads_request Set opt ='" & opt& " ', name ='" & nme& " ', des ='" & desc& " ',stt ='" & sts &"' WHERE name= '"&nm&"'"

How do I fix these so that I can grab the hidden field when I submit the form (second time) after I got the error.

Any help will be appreciaited.
Thanks
 
use session variable instead of hidden variable...

-DNG
 
Thanks for the reply. I used cookies instead of session and that worked. Sometimes session is not supported by our server for security reason.

Thanks
 
That is strange because session variables are actually cookies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top