Hi all,
I keep getting this error
"Microsoft VBScript compilation error '800a0401'
Expected end of statement
/webapps/minor/newserviceorderhtml.asp, line 43
Msg = Msg & "<a href= Approve </a>"
----------------------------------------------------------------------------------------^"
whenever i try to run the lines of code below from another page
<% @Language="VBScript"%>
</head>
<%
'declare all local variables
dim conn 'As ADO.Connection
dim rs 'As recordset
Dim myMail
'Create the Connection Object
Set dcnDB = Server.CreateObject("ADODB.Connection"
dcnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"_
& "Data Source=f:\Aspdatabase\Database\userrequisition.mdb"
dcnDB.Open
'Create the recordset object
set rs = Server.CreateObject("ADODB.Recordset"
rs.Open "SELECT * FROM Requisition", _
dcnDB, 2,2
rs.addnew
rs("To"
= request("txtTo"
rs("From"
= request("txtFrom"
rs("Centre_Code_No"
= request("txtCodeNo"
rs("Date"
= request("txtDate"
rs("Time"
= request("txtTime"
rs("Ref"
= request("txtref"
rs("Requisition_For"
= request("requestfor"
rs("Service_Desc"
= request("description"
rs("Email"
= request("HeadEmail"
rs.update
rs.MoveLast
link = rs("Requisition_id"
%>
<SCRIPT Language="VBScript" Runat="Server">
Msg = "Please Click here to approve this form"
Msg = Msg & "<a href= Approve </a>"
Set myMail = CreateObject("CDONTS.NewMail"
myMail.From = "Olanrewaju.Ogunkunle@mydomain.com"
myMail.To = "Olanrewaju.Ogunkunle@mydomain.com"
myMail.Subject = "Testing"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = Msg
myMail.Send
</SCRIPT>
<body>
<h3> Your Form has been sent to your Manager For Processing</h3>
<h3> Your Order Id is <% =rs("Requisition_id"
%> <h3>
</body>
<%
rs.close
dcnDB.Close
%>
The problem is dynamically passing rs("requisition_id"
to the href link to be sent by mail through CDONTS. If i put a value in place of rs("requisition_id"
, it works fine.
Thanks
Oysterbar ride to success. Keep Riding
I keep getting this error
"Microsoft VBScript compilation error '800a0401'
Expected end of statement
/webapps/minor/newserviceorderhtml.asp, line 43
Msg = Msg & "<a href= Approve </a>"
----------------------------------------------------------------------------------------^"
whenever i try to run the lines of code below from another page
<% @Language="VBScript"%>
</head>
<%
'declare all local variables
dim conn 'As ADO.Connection
dim rs 'As recordset
Dim myMail
'Create the Connection Object
Set dcnDB = Server.CreateObject("ADODB.Connection"
dcnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"_
& "Data Source=f:\Aspdatabase\Database\userrequisition.mdb"
dcnDB.Open
'Create the recordset object
set rs = Server.CreateObject("ADODB.Recordset"
rs.Open "SELECT * FROM Requisition", _
dcnDB, 2,2
rs.addnew
rs("To"
rs("From"
rs("Centre_Code_No"
rs("Date"
rs("Time"
rs("Ref"
rs("Requisition_For"
rs("Service_Desc"
rs("Email"
rs.update
rs.MoveLast
link = rs("Requisition_id"
%>
<SCRIPT Language="VBScript" Runat="Server">
Msg = "Please Click here to approve this form"
Msg = Msg & "<a href= Approve </a>"
Set myMail = CreateObject("CDONTS.NewMail"
myMail.From = "Olanrewaju.Ogunkunle@mydomain.com"
myMail.To = "Olanrewaju.Ogunkunle@mydomain.com"
myMail.Subject = "Testing"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = Msg
myMail.Send
</SCRIPT>
<body>
<h3> Your Form has been sent to your Manager For Processing</h3>
<h3> Your Order Id is <% =rs("Requisition_id"
</body>
<%
rs.close
dcnDB.Close
%>
The problem is dynamically passing rs("requisition_id"
Thanks
Oysterbar ride to success. Keep Riding