Asp Syntax Error Missing Operator
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About syntax error missing operator in query expression Us Learn more about Stack Overflow the company Business Learn more about hiring developers syntax error missing operator in query expression datetime or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack syntax error missing operator in query expression access Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error (missing operator) in query expression syntax error missing operator in query expression count distinct - ASP.NET up vote 4 down vote favorite Getting a syntax error with the following query: strSQL = "SELECT Customer.customer_No, Customer.customer_Name, Appointment.appointment_No,Appointment.appointment_Date, Appointment.start_Time, Appointment.end_Time FROM Customer INNER JOIN Vehicle ON Customer.customer_No = Vehicle.customer_No INNER JOIN Appointment ON Vehicle.vehicle_Ref_No = Appointment.vehicle_Ref_No" I've tried the same query in SQL Server Management Studio and it fetches the data I need. Not sure what the problem is, any help would
Syntax Error Missing Operator In Query Expression Cast
be appreciated. asp.net sql syntax share|improve this question edited Oct 3 '13 at 3:40 mhasan 14.6k54384 asked Oct 3 '13 at 2:26 user2499193 261 3 Can you post the rest of the code fragment - how the command is initialized and used? –Yuriy Galanter Oct 3 '13 at 2:29 1 Please post the error. That will be helpful. –niry Oct 3 '13 at 5:25 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote try this : strSQL =@"SELECT Customer.customer_No, Customer.customer_Name, Appointment.appointment_No,Appointment.appointment_Date, Appointment.start_Time, Appointment.end_Time FROM Customer INNER JOIN Vehicle ON Customer.customer_No = Vehicle.customer_No INNER JOIN Appointment ON Vehicle.vehicle_Ref_No = Appointment.vehicle_Ref_No" @ will allow you to write multiple lines and use escape characters. share|improve this answer answered Oct 3 '13 at 7:04 user123456 6561425 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged asp.net sql syntax
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the
Syntax Error Missing Operator In Query Expression Access Filter
company Business Learn more about hiring developers or posting ads with us Stack Overflow syntax error missing operator in query expression access 2010 Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 syntax error missing operator in query expression arcgis million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error (missing operator) in query expression up vote 0 down vote favorite I know it is a common http://stackoverflow.com/questions/19149795/syntax-error-missing-operator-in-query-expression-asp-net error, but I still can't solve it myself. What I am trying to do is I have a SELECT item called status that allow the user to choose their employment status, I want to simply get the result and update the user_table(access file) status cell. Any reply will be greatly appreciated! The Code is below: <% id=request.QueryString("id") status=request.Form("status") sql="select * from user_table where id="&id set rs=conn.execute(sql) sql="update user_table set Status='"+status+"' where http://stackoverflow.com/questions/9181067/syntax-error-missing-operator-in-query-expression id="&id 'response.Write sql conn.execute(sql) conn.close response.Write "scriptalert('Change Sucessful!');" set conn=nothing response.end() %> asp-classic share|improve this question edited Feb 8 '12 at 15:16 Shadow Wizard 49.1k1385130 asked Feb 7 '12 at 17:40 user1195283 41 4 Hello, SQL injections! –Matti Virkkunen Feb 7 '12 at 17:43 1 First: so what error are you getting and where? Second: it would probably do you some good to read this: en.wikipedia.org/wiki/SQL_injection and this: en.wikipedia.org/wiki/Security_through_obscurity –Fyodor Soikin Feb 7 '12 at 17:45 So what's the problem? And what values are you using for id and status in your tests? Also, I would recommend using parameterized queries to avoid SQL injection attacks. –CodeThug Feb 7 '12 at 17:53 Selecting something without doing anything with it is totally meaningless. –Shadow Wizard Feb 8 '12 at 15:18 Thank you so much for all of your reply! And thank you for reminding me the SQL injection problem, because it is just for myself right now. And the problem turns out I forgot to declare id and link to the database on my previous page. –user1195283 Feb 8 '12 at 22:06 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote I think you may be having a problem with conn.execute(sql) as well as respons
1 of 1 You cannot start a new topic This topic is locked [SOLVED]Syntax error (missing operator) in query expression Update Statement 7.0 build 9948 Rate Topic: #1 John Advanced Member Group: Members Posts: 362 Joined: http://www.asprunner.com/forums/topic/19058-syntax-error-missing-operator-in-query-expression/ 02-December 05 Posted 18 February 2012 - 05:50 AM Problem with update statement again . Asprunner 7.0 build 9948. The following statement syntax okay in event software . Server error ; see below. Can't see anything wrong with this???? sql="update Customers set posbal= " & values("poscost") & " * " & values("posqty") & " Where Customer ID = " & values("fldcut_num") & " " All Numeric Fields. Error Message syntax error : Microsoft JET Database Engine error '80040e14' Syntax error (missing operator) in query expression 'Customer ID = 700056699'. /cdi/output3/include/dal.asp, line 230 On Print Returns: update Customers set posbal= 2 * 15 Where Customer ID = 700056699 Which Seems Perfect???????????? Any Ideas . 0 Back to top MultiQuote Reply #2 admin Administrator Group: Admin Posts: 14943 Joined: 03-February 03 Posted 18 February 2012 - 03:25 PM The space between Customer syntax error missing and ID is the problem. If your database is MS Access use [Customer ID]=... Best regards, Sergey Kornilov 0 Back to top MultiQuote Reply #3 John Advanced Member Group: Members Posts: 362 Joined: 02-December 05 Posted 25 February 2012 - 09:51 PM admin, on 18 February 2012 - 10:25 AM, said:The space between Customer and ID is the problem. If your database is MS Access use [Customer ID]=... It was easier to change the fields to text when using a space in the field name . Learned a lesson here easier to not use space in database. Thanks admin. Solved with brackets and change back to text field. and adding sql="update Customers set posbal=posbal + (" & values("poscost") & " * " & values("posqty")& ") Where [Customer ID] IN (Select [Customer ID] from Customers where [Customer ID] = '" & values("fldcut_num") & "')" 0 Back to top MultiQuote Reply Search Topic Forum Home PHPRunner Forums |-- PHPRunner General questions |-- Tips and tricks ASPRunnerPro Forums |-- ASPRunnerPro General questions |-- Tips and tricks ASPRunner.NET Forums |-- ASPRunner.NET General questions |-- Tips and tricks |-- IronSpeed to ASPRunner.NET transition Miscellaneous |-- Suggestions |-- Xlinesoft Labs |-- Announcements |-- ASPRunner/PHPRunner change log |-- Edit/View Plugins support |