Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP error 0x800A03EE -- Can't seem to find the souce

Status
Not open for further replies.

esaragosti

Programmer
Jun 15, 2007
5
CA
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>



 
It looks to me like there is some data in your database that contains characters possibly like ',(,&," and it causes a false injection. You only get these errors when you use that data, that's why the errors are sporatic.

[monkey][snake] <.
 
Hey MonkSnake,
I had assumed that too, though my user swears she has no special characters of any kind in the fields.

I think the best course is to start by setting the asp function to replace all the illegal character with legal ones. I know that in the case of the apostraphes we just double the apostraphes (''). I guess I would use the replace(string,"'","''").

One of our techs also suggested it might be because of a french keyboard. Does that sound plausible?

Thanks again
Eric
 
though my user swears she has no special characters of any kind in the fields

I don't see how she's sure of that unless she just looked through the table.

Do you have access to the database? If so, I'd just take a look through it.

Based on the code you provided I don't see how anything inputted from a keyboard would cause the problem, unless your error was on the .Send command on the email.



[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top