esaragosti
Programmer
Hi there,
I've written a program used for HRs job postings. It works 90% of the time, but one user manages to get these errors that I can't seem to track down, and even she doesn't seem to get it all the time. The error is:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
on line 69, column 34
Line 69 is:
sqltext = "SELECT * FROM tblPosting"
And here's the more or less complete code. If anyone can help me find where the error comes from, that would be awesome, 'cause I really don't see a floating bracket anywhere. Especially 'cause it only happend sometimes ...
Thanks
Eric
<%
'Create a connection to DB. Path is \\intra\db\CampusSecurityServices.mdb
Response.Buffer = true
dim cnn,rst, Department
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=c:\db\HR\JobPostings.mdb;"
' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.message" )
' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true
' Enter the sender data
' Sender is set to Postmaster, but can be changed to the user of our choice.
msg.From = "Postmaster@postmaster.org"
msg.FromName = "Postmaster@postmaster.org"
msg.ReplyTo= "Postmaster@postmaster.org"
' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
' To change users that receive this e-mail, Change HERE.
if request.form("website")="true" then
msg.AddRecipient "Postmaster@postmaster.org"
msg.AddRecipient "Postmaster@postmaster.org"
end if
if request.form("extranet")="true" then
msg.AddRecipient "Postmaster@postmaster.org"
end if
msg.AddRecipient "Postmaster@postmaster.org"
if Request.Form("myType")="Add" then
' The subject of the message
msg.Subject = "New Job Posting"
'add a New record
sqltext = "SELECT * FROM tblPosting"
rst.Open sqltext,cnn,3,3
rst.AddNew
rst("postingDate")=now()
rst("postingJobTitle")=request.form("txtJobTitle")
' And the body
body1= body1 + "Job Title:" + request.form("txtJobTitle") + VbCrLf
if (request.form("txtReportingTo")"") then
rst("postingReportingTo")=request.form("txtReportingTo")
body1= body1 + "Reporting To:" + request.form("txtReportingTo") + VbCrLf
end if
rst("postingSalaryRange")=request.form("txtSalaryRange")
rst("organizationID_FK")=request.form("cmbAgency")
rst("postingResponsibility1")=request.form("txtTitle1")
rst("postingResponsibility2")=request.form("txtTitle2")
rst("postingResponsibility3")=request.form("txtTitle3")
rst("postingLanguage")=request.form("cmbLanguage")
rst("postingResponsibilityDetails1").AppendChunk(request.form("txtParagraph1"))
rst("postingResponsibilityDetails2").AppendChunk(request.form("txtParagraph2"))
rst("postingResponsibilityDetails3").AppendChunk(request.form("txtParagraph3"))
rst("postingApplicationProcedure").AppendChunk(request.form("txtApplicationProcedure"))
body1= body1 + "Salary Range:" + request.form("txtSalaryRange") + VbCrLf
body1= body1 + "Organization:" + request.form("cmbAgency") + VbCrLf
body1= body1 + request.form("txtTitle1")+ ": " +
request.form("txtParagraph1") + VbCrLf
body1= body1 + request.form("txtTitle2")+ ": " +
request.form("txtParagraph2") + VbCrLf
body1= body1 + request.form("txtTitle3")+ ": " +
request.form("txtParagraph3") + VbCrLf
body1= body1 + "Application Procedure:" +
request.form("txtApplicationProcedure") + VbCrLf
body1= body1 + "Posting Language:" + request.form("cmbLanguage") + VbCrLf
'put body1 into the e-mail body.
msg.body = body1
elseif Request.Form("myType")="Update" then
' The subject of the message
msg.Subject = "Updated Job Posting"
'Update existing record
sqltext = "SELECT * FROM tblPosting where postingID=" &
request.form("myPK") & ";"
rst.Open sqltext,cnn,3,3
rst("postingJobTitle")=request.form("txtJobTitle")
' And the body
body1= body1 + "Job Title " + request.form("txtJobTitle") + VbCrLf
if (rst("postingReportingTo")<>"") then
rst("postingReportingTo")=request.form("txtReportingTo")
body1= body1 + "Reporting To:" + request.form("txtReportingTo") + VbCrLf
end if
rst("postingSalaryRange")=request.form("txtSalaryRange")
rst("organizationID_FK")=request.form("cmbAgency")
rst("postingResponsibility1")=request.form("txtTitle1")
rst("postingResponsibility2")=request.form("txtTitle2")
rst("postingResponsibility3")=request.form("txtTitle3")
rst("postingLanguage")=request.form("cmbLanguage")
rst("postingResponsibilityDetails1").AppendChunk(request.form("txtParagraph1"))
rst("postingResponsibilityDetails2").AppendChunk(request.form("txtParagraph2"))
rst("postingResponsibilityDetails3").AppendChunk(request.form("txtParagraph3"))
rst("postingApplicationProcedure").AppendChunk(request.form("txtApplicationProcedure"))
body1= body1 + "Salary Range:" + request.form("txtSalaryRange") + VbCrLf
body1= body1 + "Organization:" + request.form("cmbAgency") + VbCrLf
body1= body1 + request.form("txtTitle1")+ ": " +
request.form("txtParagraph1") + VbCrLf
body1= body1 + request.form("txtTitle2")+ ": " +
request.form("txtParagraph2") + VbCrLf
body1= body1 + request.form("txtTitle3")+ ": " +
request.form("txtParagraph3") + VbCrLf
body1= body1 + "Application Procedure:" + request.form("txtReportingTo") +
VbCrLf
body1= body1 + "Posting Language:" + request.form("cmbLanguage") + VbCrLf
'put body1 into the e-mail body.
msg.body = body1
else
%>
<HTML>
<BODY>
<H1>Please print this page, and give it to your System Administrator
Immediately!</FONT></SPAN></H1>
<BR>
<FONT FACE=arial SIZE=+2>
Error: Invalid myType
</FONT>
</body>
</html>
<%
end if
rst.update
rst.Close
cnn.Close
'If SMTP Server is changed, or e-mail is no longer sent, change info HERE
if not msg.Send("smtp10.smtp.ca" ) then
Response.write "<pre>" & msg.log & "</pre>"
end if
%>
<HTML>
<BODY>
<H1>The new Posting has been added. Please contact your system administrator
if you would like to add a Logo</FONT></SPAN></H1>
<BR>
<FONT FACE=arial SIZE=+2>
You will now be automatically returned to the Main Page
</FONT>
<META HTTP-EQUIV=Refresh CONTENT="2; URL=PostingChoice.asp">
</body>
</html>
I've written a program used for HRs job postings. It works 90% of the time, but one user manages to get these errors that I can't seem to track down, and even she doesn't seem to get it all the time. The error is:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
on line 69, column 34
Line 69 is:
sqltext = "SELECT * FROM tblPosting"
And here's the more or less complete code. If anyone can help me find where the error comes from, that would be awesome, 'cause I really don't see a floating bracket anywhere. Especially 'cause it only happend sometimes ...
Thanks
Eric
<%
'Create a connection to DB. Path is \\intra\db\CampusSecurityServices.mdb
Response.Buffer = true
dim cnn,rst, Department
set cnn = Server.CreateObject("ADODB.Connection")
set rst = Server.CreateObject("ADODB.RecordSet")
cnn.Open "driver={Microsoft Access Driver
(*.mdb)};;DBQ=c:\db\HR\JobPostings.mdb;"
' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.message" )
' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true
' Enter the sender data
' Sender is set to Postmaster, but can be changed to the user of our choice.
msg.From = "Postmaster@postmaster.org"
msg.FromName = "Postmaster@postmaster.org"
msg.ReplyTo= "Postmaster@postmaster.org"
' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
' To change users that receive this e-mail, Change HERE.
if request.form("website")="true" then
msg.AddRecipient "Postmaster@postmaster.org"
msg.AddRecipient "Postmaster@postmaster.org"
end if
if request.form("extranet")="true" then
msg.AddRecipient "Postmaster@postmaster.org"
end if
msg.AddRecipient "Postmaster@postmaster.org"
if Request.Form("myType")="Add" then
' The subject of the message
msg.Subject = "New Job Posting"
'add a New record
sqltext = "SELECT * FROM tblPosting"
rst.Open sqltext,cnn,3,3
rst.AddNew
rst("postingDate")=now()
rst("postingJobTitle")=request.form("txtJobTitle")
' And the body
body1= body1 + "Job Title:" + request.form("txtJobTitle") + VbCrLf
if (request.form("txtReportingTo")"") then
rst("postingReportingTo")=request.form("txtReportingTo")
body1= body1 + "Reporting To:" + request.form("txtReportingTo") + VbCrLf
end if
rst("postingSalaryRange")=request.form("txtSalaryRange")
rst("organizationID_FK")=request.form("cmbAgency")
rst("postingResponsibility1")=request.form("txtTitle1")
rst("postingResponsibility2")=request.form("txtTitle2")
rst("postingResponsibility3")=request.form("txtTitle3")
rst("postingLanguage")=request.form("cmbLanguage")
rst("postingResponsibilityDetails1").AppendChunk(request.form("txtParagraph1"))
rst("postingResponsibilityDetails2").AppendChunk(request.form("txtParagraph2"))
rst("postingResponsibilityDetails3").AppendChunk(request.form("txtParagraph3"))
rst("postingApplicationProcedure").AppendChunk(request.form("txtApplicationProcedure"))
body1= body1 + "Salary Range:" + request.form("txtSalaryRange") + VbCrLf
body1= body1 + "Organization:" + request.form("cmbAgency") + VbCrLf
body1= body1 + request.form("txtTitle1")+ ": " +
request.form("txtParagraph1") + VbCrLf
body1= body1 + request.form("txtTitle2")+ ": " +
request.form("txtParagraph2") + VbCrLf
body1= body1 + request.form("txtTitle3")+ ": " +
request.form("txtParagraph3") + VbCrLf
body1= body1 + "Application Procedure:" +
request.form("txtApplicationProcedure") + VbCrLf
body1= body1 + "Posting Language:" + request.form("cmbLanguage") + VbCrLf
'put body1 into the e-mail body.
msg.body = body1
elseif Request.Form("myType")="Update" then
' The subject of the message
msg.Subject = "Updated Job Posting"
'Update existing record
sqltext = "SELECT * FROM tblPosting where postingID=" &
request.form("myPK") & ";"
rst.Open sqltext,cnn,3,3
rst("postingJobTitle")=request.form("txtJobTitle")
' And the body
body1= body1 + "Job Title " + request.form("txtJobTitle") + VbCrLf
if (rst("postingReportingTo")<>"") then
rst("postingReportingTo")=request.form("txtReportingTo")
body1= body1 + "Reporting To:" + request.form("txtReportingTo") + VbCrLf
end if
rst("postingSalaryRange")=request.form("txtSalaryRange")
rst("organizationID_FK")=request.form("cmbAgency")
rst("postingResponsibility1")=request.form("txtTitle1")
rst("postingResponsibility2")=request.form("txtTitle2")
rst("postingResponsibility3")=request.form("txtTitle3")
rst("postingLanguage")=request.form("cmbLanguage")
rst("postingResponsibilityDetails1").AppendChunk(request.form("txtParagraph1"))
rst("postingResponsibilityDetails2").AppendChunk(request.form("txtParagraph2"))
rst("postingResponsibilityDetails3").AppendChunk(request.form("txtParagraph3"))
rst("postingApplicationProcedure").AppendChunk(request.form("txtApplicationProcedure"))
body1= body1 + "Salary Range:" + request.form("txtSalaryRange") + VbCrLf
body1= body1 + "Organization:" + request.form("cmbAgency") + VbCrLf
body1= body1 + request.form("txtTitle1")+ ": " +
request.form("txtParagraph1") + VbCrLf
body1= body1 + request.form("txtTitle2")+ ": " +
request.form("txtParagraph2") + VbCrLf
body1= body1 + request.form("txtTitle3")+ ": " +
request.form("txtParagraph3") + VbCrLf
body1= body1 + "Application Procedure:" + request.form("txtReportingTo") +
VbCrLf
body1= body1 + "Posting Language:" + request.form("cmbLanguage") + VbCrLf
'put body1 into the e-mail body.
msg.body = body1
else
%>
<HTML>
<BODY>
<H1>Please print this page, and give it to your System Administrator
Immediately!</FONT></SPAN></H1>
<BR>
<FONT FACE=arial SIZE=+2>
Error: Invalid myType
</FONT>
</body>
</html>
<%
end if
rst.update
rst.Close
cnn.Close
'If SMTP Server is changed, or e-mail is no longer sent, change info HERE
if not msg.Send("smtp10.smtp.ca" ) then
Response.write "<pre>" & msg.log & "</pre>"
end if
%>
<HTML>
<BODY>
<H1>The new Posting has been added. Please contact your system administrator
if you would like to add a Logo</FONT></SPAN></H1>
<BR>
<FONT FACE=arial SIZE=+2>
You will now be automatically returned to the Main Page
</FONT>
<META HTTP-EQUIV=Refresh CONTENT="2; URL=PostingChoice.asp">
</body>
</html>