473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Syntax error (missing operator)

Tog
11
Hello,

I have read several posts with this heading but none of them have helped.

I have the following error message:

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'left(Your Product Ref, fldsize)='4341''.
/control/productoptions_delete.asp, line 38
=======================================

the code is:
Expand|Select|Wrap|Line Numbers
  1. dim fldsize, prodnum
  2. dim conn
  3. prodnum=request("productID")
  4. fldsize=len(prodnum)
  5. set Conn = server.createobject("ADODB.CONNECTION")
  6. Conn.Open "DBQ=" & server.mappath(".../.../db") & "\broomtacklebox.mdb"& ";Driver={Microsoft Access Driver (*.mdb)};"
  7. Conn.execute "DELETE * FROM edirectory WHERE left(Your Product Ref, fldsize)='" & Replace(prodnum, "'", "''") & "'"
  8. Conn.close
  9. set conn = nothing
  10.  
line 38 is the one that starts "Conn Execute"

I have tried several different combinations of apostrophe and double apostrophe but keep getting the same error. The field in the access database is a text field, not a number field.

Can anyone offer a solution?

Regards

Tog
Feb 13 '07 #1
4 1528
shweta123
692 Expert 512MB
Hi,

Write the query as Delete from instead of Delete * from..............

Shweta
Feb 13 '07 #2
Tog
11
I tried that, but it does not make any difference.

I wonder if it could be because I am trying to match only part of a field?

I am lost and keep trying different things but without success.

I am sure the answer is simple, but can't put my finger on it.

Tog
Feb 13 '07 #3
Tog
11
OK folks,

the answer was that the field name had spaces in it.

It appears that queries cannot be made using fields with spaces in their names.

I replaced the spaces with underscores and it worked ok.

Regards

Tog
Feb 13 '07 #4
shweta123
692 Expert 512MB
Hi,

If Prodnum is numeric value don't enclose it within quotes.
try

"DELETE * FROM edirectory WHERE left(Your Product Ref, fldsize)=" & Replace(prodnum, "'", "''") & ""

OR

check for Your Product Ref ,it may be containing null value for some record.


Shweta
Feb 13 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
4
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out...
1
by: Alan Murrell | last post by:
Hello, One of our web hosting clients is getting the following error when someone tried to log in form their login page: --- ODBC ERROR --- Microsoft OLE DB Provider for ODBC Drivers error...
3
by: kufre | last post by:
I need some fresh eyes to take a look at this code for me and let me know what it is I'm doing wrong because I keep getting all kinds of error message with this code. I've had several people help...
4
by: khan | last post by:
getting, error, 3075 Syntax Error (Missing Operator) in query expression '8WHERE .=1' Dim TotalQty As Integer TotalQty = DLookup("", "", "=" & Forms!!)
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
7
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is another text field in the query. This is...
3
by: access baby | last post by:
I hava a date parameter filter query but it shows error Syntax error missing operator in query experssion can some one please help where am i going wrong in expression SELECT copyorderdtl * ...
4
by: thebarefootnation | last post by:
Hi I have the following error message "Syntax Error (missing operator) in query expression" occurring when I am trying to update combo box within a form. My code is: Dim strSQL As String
3
by: willo | last post by:
Greetings all, I have run into a small problem with my understanding of some C++ language syntax, and seek some clarification. Below is a condensed version of some code I'm having difficulty...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.