% 'Check that the user should be allowed to access this page. 'If not, send them to another page. If Session("ReadWrite") <> "Write" Then ' 'the user is not validated to be here. Redirect to the Guest Page Response.Redirect "guest_main.asp" End If %> <% If Request.Form("btnSave") = "Save Record" Then Dim DataConnection1, cmdDC1, RecordSet1 Dim RecordToEdit, Updated, strUserName, strPassword '-- Create object and open database Set DataConnection1 = Server.CreateObject("ADODB.Connection") DataConnection1.Open "DSN=MRCDC" Set cmdDC1 = Server.CreateObject("ADODB.Command") cmdDC1.ActiveConnection = DataConnection1 SQL = "SELECT * FROM Documents" cmdDC1.CommandText = SQL Set RS1 = Server.CreateObject("ADODB.Recordset") RS1.Open cmdDC1, , 0, 2 RS1.AddNew for each objField in RS1.Fields if Not (objField.Name = "Document_ID" OR objField.Name = "doc_volume_report" OR objField.Name = "doc_pages" OR objField.Name = "doc_publication" OR objField.Name = "spatial_description") Then strCtrl = "txt" & objField.Name strField = objField.Name myValue = Request.Form(strCtrl) if NOT Left(strField,9) = "doctopics" Then if Not (myValue = "") Then RS1.Fields(objField.Name) = myValue end if else 'this is a checkbox if (Request.Form(strCtrl) = "on") Then RS1.Fields(objField.Name) = True 'response.write request.form(strctrl) & "," else RS1.Fields(objField.Name) = False end if End if End if Next RS1.Update Response.Write "
|
|||||||||
| |
|||||||||
|
|||||||||