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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!! Syntax error (missing operator) in query expression

Status
Not open for further replies.

sb7272

Programmer
Dec 3, 2003
1
GB
Hello,

I'd be really really grateful if someone could help me solve this problem.

I get this following error msg:

Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'EmployeeID ='.

Relating to this code:

set RSEmp = conn.Execute("Select * from tblEmpDir where EmployeeID =" _
& Request.QueryString("EmployeeID"))
end if


My entire code is as follows:

<%@ Language=VBScript %>
<%
strConnect= &quot;Provider=Microsoft.Jet.OLEDB.4.0; Data Source=D:\Inetpub\Set Conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
'Open the connection
Conn.Open strConnect

if NOT isempty(Request.Form(&quot;Update&quot;)) then
conn.Execute &quot;update tblEmpDir set &quot; _
& &quot;Name = '&quot; & Request.Form(&quot;Name&quot;) & &quot;', &quot; _
& &quot;EmailAddress = '&quot; & Request.Form(&quot;EmailAddress&quot;) & &quot;', &quot; _
& &quot;PhoneNumber = '&quot; & Request.Form(&quot;PhoneNumber&quot;) & &quot;', &quot; _
& &quot;Department = '&quot; & Request.Form(&quot;Department&quot;) & &quot;' where &quot; _
& &quot;EmployeeID = &quot; & Request.Form(&quot;EmployeeID&quot;)
response.redirect &quot;./manage_data_menu.asp&quot;
else

set RSEmp = conn.Execute(&quot;Select * from tblEmpDir where EmployeeID =&quot; _
& Request.QueryString(&quot;EmployeeID&quot;))
end if
%>

Id be eternally grateful if someone could solve this for me

Thanks

Sara
 
Sara,

Do any of your values have a single quote in them. If so, you need to replace them with two single quotes.

also....

Is employeeID a text field or numeric. There are no single quotes surrounding Request.Form(&quot;EmployeeID&quot;)

fengshui_1998
 
It means your querystring isn't being passed.

The best way to trouble shoot this thing is break your connectiion object up into its components.

Add on error resume next before the open statment.

Then response,write(&quot;StrSQL = &quot; & (your SQLstatement))

Are you sure it isn't supposed to be request.form(&quot;&quot;)? Just try request(&quot;EmplyeeID&quot;) and see the result.

Or display your querys tring on the page.

You get the idea? You need to see what is in the SQL statement


Steve Davis
hey.you@hahaha.com.au

Me? I can't even spell ASP!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top