Print Page | Close Window

Customizing message

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8502
Printed Date: 01 April 2026 at 7:18am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Customizing message
Posted By: Sammy
Subject: Customizing message
Date Posted: 02 January 2004 at 2:49pm

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
%>

 

 




Replies:
Posted By: Sammy
Date Posted: 02 January 2004 at 3:21pm

Please ignore my post; I wasn't thinking.

I have it working the way I want it.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net