Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error. Can you help

Status
Not open for further replies.

mmchenney

Technical User
May 16, 2001
16
0
0
US
Getting Syntax error with this code: Can you help!

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'region ='.

/regions/webpages/HHSC_Voice_Consolidation/UpdateDelete.asp, line 11


<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include virtual=&quot;/regions/Connections/regional_personnel1.asp&quot; -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = &quot;1&quot;
if (Request.QueryString(&quot;Select&quot;) <> &quot;&quot;) then Recordset1__MMColParam =
Request.QueryString(&quot;Select&quot;)
%>
<%
set Recordset1 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Recordset1.ActiveConnection = MM_regional_personnel1_STRING
Recordset1.Source = &quot;SELECT * FROM PBX WHERE region = &quot; & Session(&quot;region&quot;)&
&quot; ORDER BY city ASC&quot;
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Thanks,

Molly

 
Recordset1.ActiveConnection = MM_regional_personnel1_STRING
Recordset1.Source = &quot;SELECT * FROM PBX WHERE region = &quot;
& Session(&quot;region&quot;)& &quot; ORDER BY city ASC&quot;

If region is a char-type column, then I think you need to wrap the value inside single quotes

&quot;SELECT * FROM PBX WHERE region = '&quot;
& Session(&quot;region&quot;)& &quot;' ORDER BY city ASC&quot;

Can you see where I have put them?

P.S.
This is the SQL Server forum, but it looks like you are working with Access.

 
Now I'm getting this error:
MMColPara
An invalid variable it doe not appear in SQL

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include virtual=&quot;/regions/Connections/regional_personnel1.asp&quot; -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = &quot;1&quot;
if (Request.QueryString(&quot;Select&quot;) <> &quot;&quot;) then Recordset1__MMColParam = Request.QueryString(&quot;Select&quot;)
%>
<%
set Recordset1 = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Recordset1.ActiveConnection = MM_regional_personnel1_STRING
Recordset1.Source = &quot;SELECT * FROM HHSC_VoiceInventory WHERE region = '&quot;& Session(&quot;region&quot;)& &quot;' ORDER BY city ASC&quot;
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
%
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top