Current location: Hot Scripts Forums » Programming Languages » ASP » Syntax error (missing operator) in query expression 'Site_Info.Location_ID='.


Syntax error (missing operator) in query expression 'Site_Info.Location_ID='.

Reply
  #1 (permalink)  
Old 02-27-09, 03:33 PM
minime minime is offline
New Member
 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Syntax error (missing operator) in query expression 'Site_Info.Location_ID='.

I am hoping someone has seen this before. The query I have on my page works fine. When I submit the form which simply updates a table I get the error that the query is broke. I have a text box that I use to hold the variable and after I submit the page it is blank which would explain the error. I do not know why after I submit the page the field is blank.. HELP........
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-01-09, 08:51 PM
Dwagar's Avatar
Dwagar Dwagar is offline
Newbie Coder
 
Join Date: Sep 2008
Location: Ohio
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Syntax error (missing operator) in query expression 'Site_Info.Location_ID='

This can be a number of causes, can you provide some code and I'll see if I can help you out?
__________________
SepCity Portal Solutions
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-02-09, 09:54 AM
minime minime is offline
New Member
 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I used to pass the information through using a link in the previous page. I changed to a query with a single variable and that is when I broke it.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Line Update Form</TITLE>
<META content="Microsoft FrontPage 6.0" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><LINK 
href="../Template1_files/consol.css" type=text/css 
rel=stylesheet></HEAD>
<BODY>
<form method="POST" action="--WEBBOT-SELF--">
<b>
<input Type="text" NAME="hdnAction1" VALUE="0">
<input type="text" name="Mainlocationid" size="10" value="<%Response.Write Request.QueryString("Mainlocationid")%>">&nbsp;

<input type="hidden" name="SYSlocationid" size="10" value="<%= rs2("location_id")%>">&nbsp;
<input type="hidden" name="System" size="48" value="<%= rs2("System")%>">
<input type="hidden" name="Gateway_Model" size="27" value="<%= rs2("Gateway_Model")%>">
<input type="hidden" name="UPSModel" size="3" value="<%= rs2("UPS_Model")%>">&nbsp;&nbsp; 
<input type="hidden" name="Server_Model" size="10" value="<%= rs2("Server_Model")%>">
<input type="hidden" name="UdateVM" size="3" value="<%= rs2("Audix")%>">

<input type="text" name="Mainlocationid" size="10" value="<%Response.Write Request.QueryString("Mainlocationid")%>"><p align="left"><b>Sold to Number:&nbsp;<input type="text" name="Sold_To" size="29" value="<%= rs2("Sold_To")%>">&nbsp;&nbsp;&nbsp;&nbsp;</b><b>&nbsp;&nbsp;&nbsp;&nbsp;DID 
Ranges:&nbsp; 
<input type="text" name="DID_Ranges" size="23" value="<%= rs2("DID_Ranges")%>"></b><p align="left">
<b>Cisco Port#: &nbsp;<input type="text" name="Cisco_Port_No" size="29" value="<%= rs2("Cisco_Port_No")%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Port 
Network#: &nbsp;<input type="text" name="Port_Network_No" size="18" value="<%= rs2("Port_Network_No")%>">&nbsp;INADS 
Line:&nbsp; 
<input type="text" name="INADS" size="13" value="<%= rs2("INADS")%>"></b><p align="left">

<b>System Type</b>

<b>

	<input type="radio" id="V19" value="Current" name="SysType" checked></b>&nbsp;<b><font color="#0000FF"><%Response.Write Request.QueryString("System")%></font></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>Change System Type:</b>
   
   <Select Name="System_Types" SIZE="1">
    <option>Please Choose One</option>
    <option>CM 3</option>
	<option>CM 4</option>
	<option>CM 5</option>
    <option>Key System</option>
	<option>Merlin System</option>
	<option>Partner System</option>
    </select>&nbsp;&nbsp;&nbsp;

	<input type="radio" id="V20" value="New" name="SysType">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Subnet:&nbsp;&nbsp;&nbsp;

<input type="text" name="Subnet" size="10" value="<%= rs2("Location_Subnet")%>"></b><p align="left">
<b>System Number:&nbsp;&nbsp;&nbsp; </b>

<input type="text" name="System_Number" size="30" value="<%= rs2("System_Number")%>">&nbsp;&nbsp;&nbsp;

<b>Contract Expiration Date:&nbsp;&nbsp;&nbsp; </b>
<input type="text" name="date" id="date1" size="11" valign="top" value="<%= rs2("Maint_Contract_Exp")%>">
<span name="date" id="date">
		
	<img src="../calendar.gif" name="ChoseDate" id="ChoseDate" IndexVal="date1" onclick="vbscript:CALL GetDate(Me)" WIDTH="25" HEIGHT="21">
</span><span name="date" id="date2">
		<script LANGUAGE="vbSCript">
	sub window_onload()
	end sub

	Sub GetDate(objMe)
		strThisElement = objMe.getattribute("IndexVal")
		retVal = window.showModalDialog ("calDraw1.asp?Locale=Set",,"dialogWidth:248px;dialogHeight:225px;status: no;unadorned: yes;help: no;scroll:no")
				
		If retVal <> "" Then
			document.all(strThisElement).value = retVal
		End If		
	End Sub
		</script>
		<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

	<body style="position: relative">
		<form name="FrontPage_Form2" id="frmMain" onsubmit="return FrontPage_Form2_Validator(this)" language="JavaScript">
			<span name="date" id="date">

<p align="left">

<b>Gateway Model:&nbsp;

	<font color="#0000FF">
</font><input type="radio" id="V15" value="Current" name="WkRequest"></b><font color="#0000FF">
</font>
<b>&nbsp;&nbsp;&nbsp;<font color="#0000FF"><%Response.Write Request.QueryString("Gateway_Model")%></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Change Gateway Model:&nbsp;

<Select Name="GtwyModel" SIZE="1">
  <option>Please Choose One</option>
	<option>G350</option>
	<option>G450</option>
	<option>G650</option>
  <option>G700</option>
  </select>

<input type="radio" id="V14" value="New" name="WkRequest">&nbsp;&nbsp;</b><b> 
Mid#:<input type="text" name="MID_No" size="3" value="<%= rs2("MID_No")%>">&nbsp;&nbsp;&nbsp;&nbsp;Sid#:&nbsp;<input type="text" name="SID_No" size="6" value="<%= rs2("SID_No")%>"></p>
<p align="left"> 
Gateway#1 : <%Response.Write rs2("Location_Subnet")%><input type="text" name="Gateway1" size="1" value="<%= rs2("Gateway1_Address")%>">&nbsp;&nbsp;&nbsp; 
S/N :
	
	
	<input type="text" name="GatewaySN1" size="15" value="<%= rs2("Gateway1_Serial")%>">&nbsp; Gateway#2&nbsp; :<%Response.Write rs2("Location_Subnet")%><input type="text" name="Gateway2" size="1" value="<%= rs2("Gateway2_Address")%>">
<font color="#0000FF">&nbsp; </font>S//N :
	
	
	<input type="text" name="GatewaySN2" size="15" value="<%= rs2("Gateway2_Serial")%>"> </p>
<p align="left"> 
Gateway#3 : <%Response.Write rs2("Location_Subnet")%><input type="text" name="Gateway3" size="1" value="<%= rs2("Gateway3_Address")%>">
<font color="#0000FF">&nbsp;&nbsp; </font>S/N :
	
	
	<input type="text" name="GatewaySN3" size="15" value="<%= rs2("Gateway3_Serial")%>">&nbsp;&nbsp; Gateway#4 : 
<%Response.Write rs2("Location_Subnet")%><input type="text" name="Gateway4" size="1" value="<%= rs2("Gateway4_Address")%>">
<font color="#0000FF">&nbsp;&nbsp;</font>S/N :
	
	
	<input type="text" name="GatewaySN4" size="15" value="<%= rs2("Gateway4_Serial")%>">
<font color="#0000FF">&nbsp;&nbsp;&nbsp;&nbsp; </font></p>
<p align="left">
 
    &nbsp;CLan#1:
	
	
	<%Response.Write rs2("Location_Subnet")%><input type="text" name="CLan1" size="3" value="<%= rs2("CLan1_Address")%>">&nbsp;&nbsp;&nbsp;&nbsp; 
	CLan#2: <%Response.Write rs2("Location_Subnet")%><input type="text" name="CLan2" size="3" value="<%= rs2("CLan2_Address")%>">&nbsp;&nbsp;&nbsp; 
	CLan#3:<%Response.Write rs2("Location_Subnet")%><input type="text" name="CLan3" size="3" value="<%= rs2("CLan3_Address")%>">&nbsp;&nbsp;&nbsp;&nbsp; 
	CLan#4:<%Response.Write rs2("Location_Subnet")%><input type="text" name="CLan4" size="3" value="<%= rs2("CLan4_Address")%>"> </p>
<p align="left">
 
    VOIP#1:<%Response.Write rs2("Location_Subnet")%><input type="text" name="VOIP1" size="3" value="<%= rs2("VOIP1_Address")%>">&nbsp;&nbsp;&nbsp;&nbsp; 
	VOIP#2 :<%Response.Write rs2("Location_Subnet")%><input type="text" name="VOIP2" size="3" value="<%= rs2("VOIP2_Address")%>">&nbsp;&nbsp;&nbsp;&nbsp; 
	VOIP#3:<%Response.Write rs2("Location_Subnet")%><input type="text" name="VOIP3" size="3" value="<%= rs2("VOIP3_Address")%>">&nbsp;&nbsp;&nbsp;&nbsp; 
	VOIP#4: <%Response.Write rs2("Location_Subnet")%><input type="text" name="VOIP4" size="3" value="<%= rs2("VOIP4_Address")%>"> </p><p align="left">

UPS :
	
	
	<%Response.Write rs2("Location_Subnet")%><input type="text" name="UPS" size="3" value="<%= rs2("UPS_Address")%>">&nbsp;&nbsp;&nbsp; 
UPS Model:&nbsp;
<input type="radio" id="V21" value="Current" name="UPSMdl" checked><font color="#0000FF">
</font>
&nbsp;&nbsp;&nbsp;<font color="#0000FF"><%Response.Write Request.QueryString("Gateway_Model")%></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
UPS Model:&nbsp;

<Select Name="NewUPSModel" SIZE="1">
  <option>Please Choose One</option>
	<option>350</option>
	<option>450</option>
	<option>650</option>
  <option>700</option>
  </select>

<input type="radio" id="V22" value="New" name="UPSMdl">&nbsp;&nbsp;<p align="left">
 
    Stack Processor :<%Response.Write rs2("Location_Subnet")%><input type="text" name="Stack" size="3" value="<%= rs2("Stack_Address")%>">&nbsp;&nbsp;&nbsp; 
	</p>
<p align="left">
 
    Media Processor#1: <%Response.Write rs2("Location_Subnet")%><input type="text" name="MedProc1" size="3" value="<%= rs2("MediaProc1_Address")%>">&nbsp;&nbsp;&nbsp; 
	Media Processor#2:
	
	
	<%Response.Write rs2("Location_Subnet")%><input type="text" name="MedProc2" size="3" value="<%= rs2("MediaProc2_Address")%>">&nbsp;&nbsp;&nbsp; 
	Media Processor#3:<%Response.Write rs2("Location_Subnet")%><input type="text" name="MedProc3" size="3" value="<%= rs2("MediaProc3_Address")%>"></p>
<p align="left">
 
    Server :
	
	
	<%Response.Write rs2("Location_Subnet")%><input type="text" name="Server" size="3" value="<%= rs2("Server_Address")%>">&nbsp;&nbsp;S/N :
	
	
	<input type="text" name="ServerSN" size="15" value="<%= rs2("Server_Serial")%>">&nbsp;
 
    Model:
<input type="radio" id="V16" value="Current" name="SvrModel" checked> 
	<font color="#0000FF"> 
</font>&nbsp;<font color="#0000FF"><%Response.Write Request.QueryString("Server_Model")%></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
	Change Model:<!--webbot bot="Validation" b-value-required="TRUE" --><Select Name="NewServerMdl" SIZE="1">


  <option>Choose a Server</option>
<option>8300</option>
<option>8300b</option>
<option>8300c</option>
<option>8500</option>
<option>8720</option>

  </select> <input type="radio" id="V12" value="New" name="SvrModel"></p>


  <p align="left">
 
    Voice Mail:&nbsp;

<input type="radio" id="V24" value="Current" name="VM" checked>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<Select Name="NewVM" SIZE="1">
  <option>Choose One</option>
	<option>Yes</option>
	<option>No</option>
  </select>

<input type="radio" id="V23" value="New" name="VM">&nbsp;&nbsp;&nbsp; Address: 
	111.222.333.<input type="text" name="VMAddress" size="3" value="<%= rs2("Audix_Address")%>">&nbsp;&nbsp;&nbsp; 
	Dialup 
Line:&nbsp; 
<input type="text" name="VMDialup" size="13" value="<%= rs2("Audix_Dialup")%>"></p>Notes: 
>"><p>&nbsp;

Last edited by Yeroon; 03-02-09 at 10:44 AM. Reason: Code tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-02-09, 09:56 AM
minime minime is offline
New Member
 
Join Date: Feb 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Here is the query.

Code:
sql = "SELECT Site_Info.Dsply_Form, Site_Info.Mod_Flag, Site_Info.Hub_ID, Site_Info.Man_Entry, Site_Info.Location_ID1, Site_Info.Network_ID, Site_Info.Internet_Service, Site_Info.Location_ID, Site_Info.Bill_Grp, Site_Info.One_Net, Site_Info.Cost_Center, Site_Info.Comp_Code, Site_Info.GroupName, Site_Info.Name, Site_Info.Address, Site_Info.City, Site_Info.State, Site_Info.Zip, Site_Info.Contact, Site_Info.Contact_Phone, Site_Info.RemoteTech_ID, Site_Info.Afterhours_Contact, Site_Info.Afterhours_Phone, Site_Info.Contact_Hours, System_Info.Name, System_Info.Sold_To, System_Info.System, System_Info.System_Number, System_Info.Notes, System_Info.Directions, System_Info.MID_No, System_Info.SID_No, System_Info.Maint_Contract_Exp, System_Info.Cisco_Port_No, System_Info.INADS, System_Info.Port_Network_No, System_Info.DID_Ranges, System_Info.Location_Subnet, System_Info.Gateway_Model, System_Info.Gateway1_Address, System_Info.Gateway1_Serial, System_Info.Gateway2_Address, System_Info.Gateway2_Serial, System_Info.Gateway3_Address, System_Info.Gateway3_Serial, System_Info.Gateway4_Address, System_Info.Gateway4_Serial, System_Info.Server_Model, System_Info.Server_Address, System_Info.Server_Serial, System_Info.Stack_Processor, System_Info.Stack_Address, System_Info.UPS_Model, System_Info.UPS_Address, System_Info.Audix, System_Info.Audix_Address, System_Info.Audix_Dialup, System_Info.CLan1_Address, System_Info.CLan2_Address, System_Info.CLan3_Address, System_Info.CLan4_Address, System_Info.VOIP1_Address, System_Info.VOIP2_Address, System_Info.VOIP3_Address, System_Info.VOIP4_Address, System_Info.MediaProc1_Address, System_Info.MediaProc2_Address, System_Info.MediaProc3_Address, RemoteTech_Info.LastName, RemoteTech_Info.FirstName, RemoteTech_Info.work, RemoteTech_Info.cell, RemoteTech_Info.Home, RemoteTech_Info.Home_work, RemoteTech_Info.E_Mail, RemoteTech_Info.Type, Hub_Info.HubName, Hub_Info.HubDescription, Hub_Info.Type FROM (RemoteTech_Info INNER JOIN (Site_Info INNER JOIN System_Info ON Site_Info.Location_ID = System_Info.Location_ID) ON RemoteTech_Info.ID = Site_Info.RemoteTech_ID) INNER JOIN Hub_Info ON Site_Info.Hub_ID = Hub_Info.Hub_ID WHERE Site_Info.Location_ID= " & testid &  " "

Last edited by Yeroon; 03-02-09 at 10:45 AM. Reason: Code tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-02-09, 10:47 AM
Yeroon's Avatar
Yeroon Yeroon is offline
Code Master
 
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
If the value needs to come from the hidden field called: SYSlocationid, then try this

Code:
sql = "SELECT Site_Info.Dsply_Form, Site_Info.Mod_Flag, Site_Info.Hub_ID, Site_Info.Man_Entry, Site_Info.Location_ID1, Site_Info.Network_ID, Site_Info.Internet_Service, Site_Info.Location_ID, Site_Info.Bill_Grp, Site_Info.One_Net, Site_Info.Cost_Center, Site_Info.Comp_Code, Site_Info.GroupName, Site_Info.Name, Site_Info.Address, Site_Info.City, Site_Info.State, Site_Info.Zip, Site_Info.Contact, Site_Info.Contact_Phone, Site_Info.RemoteTech_ID, Site_Info.Afterhours_Contact, Site_Info.Afterhours_Phone, Site_Info.Contact_Hours, System_Info.Name, System_Info.Sold_To, System_Info.System, System_Info.System_Number, System_Info.Notes, System_Info.Directions, System_Info.MID_No, System_Info.SID_No, System_Info.Maint_Contract_Exp, System_Info.Cisco_Port_No, System_Info.INADS, System_Info.Port_Network_No, System_Info.DID_Ranges, System_Info.Location_Subnet, System_Info.Gateway_Model, System_Info.Gateway1_Address, System_Info.Gateway1_Serial, System_Info.Gateway2_Address, System_Info.Gateway2_Serial, System_Info.Gateway3_Address, System_Info.Gateway3_Serial, System_Info.Gateway4_Address, System_Info.Gateway4_Serial, System_Info.Server_Model, System_Info.Server_Address, System_Info.Server_Serial, System_Info.Stack_Processor, System_Info.Stack_Address, System_Info.UPS_Model, System_Info.UPS_Address, System_Info.Audix, System_Info.Audix_Address, System_Info.Audix_Dialup, System_Info.CLan1_Address, System_Info.CLan2_Address, System_Info.CLan3_Address, System_Info.CLan4_Address, System_Info.VOIP1_Address, System_Info.VOIP2_Address, System_Info.VOIP3_Address, System_Info.VOIP4_Address, System_Info.MediaProc1_Address, System_Info.MediaProc2_Address, System_Info.MediaProc3_Address, RemoteTech_Info.LastName, RemoteTech_Info.FirstName, RemoteTech_Info.work, RemoteTech_Info.cell, RemoteTech_Info.Home, RemoteTech_Info.Home_work, RemoteTech_Info.E_Mail, RemoteTech_Info.Type, Hub_Info.HubName, Hub_Info.HubDescription, Hub_Info.Type FROM (RemoteTech_Info INNER JOIN (Site_Info INNER JOIN System_Info ON Site_Info.Location_ID = System_Info.Location_ID) ON RemoteTech_Info.ID = Site_Info.RemoteTech_ID) INNER JOIN Hub_Info ON Site_Info.Hub_ID = Hub_Info.Hub_ID 

WHERE Site_Info.Location_ID= " & Request.Form("SYSlocationid")
If the ID is a text field instead of numeric use:

Code:
WHERE Site_Info.Location_ID= '" & Request.Form("SYSlocationid") & "'"
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 03-11-09, 03:51 AM
furthersorion furthersorion is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
What version of asp are you using?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Error Nikas Database 4 05-15-08 11:48 AM
help please (missing operator) in query expression 'catagoryID ='. pez ASP 2 02-22-06 08:53 AM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM
Syntax error (missing operator) in query expression crobinson ASP 4 11-23-03 09:49 PM


All times are GMT -5. The time now is 11:05 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.