473,414 Members | 1,630 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,414 software developers and data experts.

Help with form results in query

Ken
How can I get this line to work? I am trying to get the results entered in a
form to be part of my query. I am able to get the form results but I get a
error stating Syntax error (missing operator) in query expression 'Assignee
= Tom Jones'.
Below is the line where the error occurs

Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")

Thanks
Ken
Jul 19 '05 #1
4 1610
"Ken" <kl*****@spamfreeingr.com> wrote in message
news:uT**************@TK2MSFTNGP10.phx.gbl...
How can I get this line to work? I am trying to get the results entered in a form to be part of my query. I am able to get the form results but I get a
error stating Syntax error (missing operator) in query expression 'Assignee = Tom Jones'.
Below is the line where the error occurs

Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")


Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'"

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #2
Ken
Now this is giving me problems. Is this the correct way ?
Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'" or
"Add_Assignees = '" & Request.Form("assignsearch") & "'"
"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bl**********@kcweb01.netnews.att.com...
"Ken" <kl*****@spamfreeingr.com> wrote in message
news:uT**************@TK2MSFTNGP10.phx.gbl...
How can I get this line to work? I am trying to get the results entered in
a
form to be part of my query. I am able to get the form results but I get
a error stating Syntax error (missing operator) in query expression

'Assignee
= Tom Jones'.
Below is the line where the error occurs

Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")


Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'"

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running

IIS http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #3
You can't use an "or" like that. You can't assign a value to a
Session variable with an "or". You can use an
"if...or...then...else" when testing for a current value, but you
haven't made it clear what you are trying to do. Let use know what you
are *really* trying to do,...you may have to change your whole
approach.

--

Phillip Windell [CCNA, MVP, MCP]
pw******@wandtv.com
WAND-TV (ABC Affiliate)
www.wandtv.com

"Ken" <kl*****@spamfreeingr.com> wrote in message
news:ud**************@TK2MSFTNGP09.phx.gbl...
Now this is giving me problems. Is this the correct way ?
Session("dbWhere") = "Assignee = '" & Request.Form("assignsearch") & "'" or "Add_Assignees = '" & Request.Form("assignsearch") & "'"

Jul 19 '05 #4
Ken wrote:
How can I get this line to work? I am trying to get the results
entered in a form to be part of my query. I am able to get the form
results but I get a error stating Syntax error (missing operator) in
query expression 'Assignee = Tom Jones'.
Below is the line where the error occurs

Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")

Whenever you have this type of error, use response.write to see the results
of your concatenation. You have no hope of troubleshooting this just by
looking at the code. You need to see the result.

Bob Barrows
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: James | last post by:
My form and results are on one page. If I use : if ($Company) { $query = "Select Company, Contact From tblworking Where ID = $Company Order By Company ASC"; }
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
5
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table,...
8
by: pamelafluente | last post by:
I am beginning aspNet, I know well win apps. Need a simple and schematic code example to start work. This is what I need to accomplish: ---------------------- Given button and a TextBox on a...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
47
by: Jo | last post by:
Hi there, I'm Jo and it's the first time I've posted here. I'm in process of creating a database at work and have come a little unstuck.....I'm a bit of a novice and wondered if anyone could...
5
by: deaconj999 | last post by:
Hi, I have nearly finished my database and I would like to add a query that uses a combo box to get the results, not the usual paramater style input. I suppose it would need a form and a query...
1
by: tomlebold | last post by:
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.