I need help in customizing the message for this code.
If my update is successful, I need the message to display at the top of the page. Likewise if it is not successful.
For instance,
I have this screen:
Job Successully Uploaded!
Enter PIN___________________________submit
After entering this pin, if there is a matching record on the db, a second page is display for editing.
After successul updation, I will to say at the top of the page:
Job successful uploaded. If not, I will like to say Unsuccessful upload but I want above, please see it.
So far, the message appears in a separate page.
<%
uploaddir = "Upload" ' Folder where they will store the files.
UPLOADDIRECTORY = Server.MapPath(uploaddir)
Set Upload = Server.CreateObject("Persits.Upload.1") &nb sp; ' This is the correct code.
Upload.SetMaxSize 1048576 ' Truncate files above 1MB
Upload.OverwriteFiles = True
Count = Upload.Save(UPLOADDIRECTORY)
Set File = Upload.Files("File1")
If Not File Is Nothing Then
'Response.Write File.ExtractFilename
Filename = File.ExtractFilename
Filesize = File.Size
contentType = File.Ext 'UCase(Right(File.Path, 3))
fileData = File.Binary
else
Filename = ""
End If
'Check your update statement. Update the description in accidentnumber field it seems. Other wise write the code like this. oRs is the recordset object
Set oRs=Server.CreateObject("ADODB.Recordset")
Set DbObjmembers = Server.CreateObject("ADODB.Connection")
DbObjmembers.Open "dsn=jobs"
'oRs.open "Select * from ImageFiles where filename='"&filename&"';",DbObjmembers,1,3
oRs.open "Select * from ImageFiles Where ID="&Upload.form("A_Number"),DbObjmembers,1,3
if count > 0 then
if oRs.eof then
oRs.addnew
oRs("filesize") = filesize
oRs("contentType") = contentType
oRs("filedata") = filedata
oRs("filename") = filename
oRs("description") = Upload.form("description")
oRs("AccidentNumber") = Upload.form("accidentNumber")
oRs.Update
else
oRs("filesize") = filesize
oRs("contentType") = contentType
oRs("filedata") = filedata
oRs("filename") = filename
oRs("description") = Upload.form("description")
oRs("AccidentNumber") = Upload.form("accidentNumber")
oRs.Update
end if
Response.Write "<font color=""green"">Job was successfully stored...</font>"
Else
Response.Write "<font color=""brown"">Job Upload Unsuccessful...</font>"
End If
%>