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!

Microsoft ODBC Microsoft Access Driver

Status
Not open for further replies.

mmchenney

Technical User
May 16, 2001
16
0
0
US
Help me I'm getting an error:

Microsoft ODBC Microsoft Access Driver Syntax error in string Query expression 'regions='

<%@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
%>
<%

Thanks,

Molly
 
Hello!
As you probably already know, it basically means that it is not getting the session value for region. Of what I can see, try and remove the single quote ( ' ) on the outside of the defined session variable.

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

This should work!! One other thing, in your error it says &quot;regions=&quot; and your sql source is &quot;region&quot;? Is there a typo there? If so, that could also be your syntax problem... Candie ;o)

&quot;Mere distances between 2 people bring you all that much closer in the end!&quot;
 
response.write(&quot;Recordset1.Source&quot;) to the screen to see what it is trying to do, as Candie said it will probably become obvious then A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx (1895-1977)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top