Dear all,
I have the following code which add a new record to
database, after the record has been added. I want to prompt a message
"Hello". But the following script does not promt.
Response.Write("<script>")
Response.Write("alert (""Hello"");")
response.write("</script>")
It just goto Response.redirect "OS_addnew.asp"
The following is my complete code:
if strshipper<>"" and strorigin<>"" and strdest<>"" and
strinvoice_no<>"" and strpo_no<>"" then
'************************************************* *************************
' Insert Data
'************************************************* *************************
Set objConn1 = Server.CreateObject("ADODB.Connection")
objConn1.Open "driver={SQL
Server};server=10.129.2.20;database=FIH;uid=sa;pwd =sa"
strSQL = "INSERT Oversea
(os_no,forwarder,station,service_level,shipper,con signee,origin,dest,incoterms,invoice_no,po_no,good s_desc,bu,qty,plt,ctn,loose_ctn,gw_hawb,cw_hawb,"
&_
"gw_pl,cw_pl,shpt_value,booking_receiving_date,boo king_receiving_time,cargo_receiving_date,cargo_rec eiving_time,flight_no,flight_no1,flight_no2,flight _no3,"
&_
"etd_date,etd_time,etd_date1,etd_time1,etd_date2,e td_time2,etd_date3,etd_time3,eta_date,eta_time,eta _date1,eta_time1,eta_date2,eta_time2,eta_date3,eta _time3,"
&_
"hawb,mawb,mawb1,mawb2,mawb3,completed_date,comple ted_time,available_pu_date,available_pu_time,pod_d ate,pod_time,receiving_wh,event_report,inbound_no, outbound_no,remark,forwarder_pickup)"
&_
" values ('" & newdatecode &"','" & strforwarder &"','" &
strstation &"','" & strservice_level &"','" & strshipper &"','" &
strconsignee &"','" & strorigin &"','" & strdest &"', '" &
strincoterms &"','" & strinvoice_no &"','" & strpo_no &"','" &
strgoods_desc &"','" & strbu &"','" & strqty &"','" & strplt &"','" &
strctn &"','" & strloose_ctn &"','" & strgw_hawb &"','" & strcw_hawb
&"'," &_
"'" & strgw_pl &"','" & strcw_pl &"','" & strshpt_value &"'," &
strbooking_receiving_date &"," & strbooking_receiving_time &"," &
strcargo_receiving_date &"," & strcargo_receiving_time &",'" &
strflight_no &"','" & strflight_no1 &"','" & strflight_no2 &"','" &
strflight_no3 &"'," &_
"" & stretd_date &"," & stretd_time &"," & stretd_date1 &"," &
stretd_time1 &"," & stretd_date2 &"," & stretd_time2 &"," &
stretd_date3 &"," & stretd_time3 &"," & streta_date &"," & streta_time
&"," & streta_date1 &"," & streta_time1 &"," & streta_date2 &"," &
streta_time2 &"," & streta_date3 &"," & streta_time3 &"," &_
"'" & strhawb &"','" & strmawb &"','" & strmawb1 &"','" &
strmawb2 &"','" & strmawb3 &"'," & strcompleted_date &"," &
strcompleted_time &","& stravailable_pu_date &"," &
stravailable_pu_time &","& strPOD_date &"," & strPOD_time &",'" &
strreceiving_wh &"','" & strevent_report &"','" & strinbound_no &"','"
& stroutbound_no &"','" & strremark & "','" & strforwarder_pickup &
"')"
objConn1.Execute strSQL
Response.Write("<script>")
Response.Write("alert (""Hello"");")
response.write("</script>")
Response.redirect "OS_addnew.asp"
end if
Please Help. Thanks.