473,657 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Syntax error (missing operator)

Tog
11 New Member
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 1545
shweta123
692 Recognized Expert Contributor
Hi,

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

Shweta
Feb 13 '07 #2
Tog
11 New Member
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 New Member
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 Recognized Expert Contributor
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
2477
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" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
4
18044
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 on me for some reason. The Summary field is pulled from a Rich Text Editor that allows HTML formatting and appears to be the culprit, but I just can't seem to figure out why. Any guidance is greatly appreciated. I'm connecting to an Access...
1
6863
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 '80040e14' Syntax error (missing operator) in query expression 'userid= AND password='''.
3
2661
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 me with this code and every thing that've told me I've done but for the life of me I can't seem to get this working right. First I keep getting "Type mismatch" error message for this line of code: StrProject = Str(Me!cboProjectID) but if I take...
4
18217
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
22613
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 quotes? Do I need to use code to scrub each string and remove or escape the double quotes before using it in a query? The error I get is this: Error Number 3075: Syntax error (missing operator) in query expression '"credit card billed by...
7
6876
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 expression should return the 4 leftmost characters of the FilmNo
3
4925
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 * from copyorderdtl where(((cr_created_date)is Null) and ((cr_statusupdt_date)=)) OR (((cr_created_date) is not null and (cr_statusupdt_Date)=));
4
14996
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
1526
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 with: =============================================================== #include <cstddef// size_t
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.