Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Recordset Help

New Here ,
Jul 06, 2007 Jul 06, 2007
Hi

On my access database i created a query, i then open dreamweaver and create a recordset based on that query.

Basically all i am doing is pulling data from two tables in the query, if i test the recordset all works fine, as soon as i add a statement saying only return results that are equal to MMCParam which is a form input field on the page, i get the error

Syntax error in query expression, any idears why this is.

I have tested the query on a recordset just pulling from one table and all works fine it just seems to happen when i build the recorset on the query.


Please help

John
TOPICS
Server side applications
378
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 07, 2007 Jul 07, 2007
Please paste the code for the Recordset.


"pepps" <webforumsuser@macromedia.com> wrote in message
news:f6lo2o$o2i$1@forums.macromedia.com...
> Hi
>
> On my access database i created a query, i then open dreamweaver and
> create a
> recordset based on that query.
>
> Basically all i am doing is pulling data from two tables in the query, if
> i
> test the recordset all works fine, as soon as i add a statement saying
> only
> return results that are equal to MMCParam which is a form input field on
> the
> page, i get the error
>
> Syntax error in query expression, any idears why this is.
>
> I have tested the query on a recordset just pulling from one table and all
> works fine it just seems to happen when i build the recorset on the query.
>
>
> Please help
>
> John
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 09, 2007 Jul 09, 2007
LATEST
Dim Recordset1__MMColParam
Recordset1__MMColParam = "advanced"
If (Request.Form("search") <> "") Then
Recordset1__MMColParam = Request.Form("search")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_linkmicrotek_STRING
Recordset1_cmd.CommandText = "SELECT Supplier, Product_Type, Part_No, Frequency, Connector_Type, Average_Power_Handling, Switch_Type, Package, Gain, Pout, P1dB_Output, Output_IP3, Attenuation, Reverse_Voltage, name FROM Category WHERE Product_Type Like ?"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5, 1, 1073741823, "%" + Recordset1__MMColParam + "%") ' adDouble

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows

This is the results page from a keyword search, the form variable is called search. As soon as i add the sql to say if like MMColParam thats when it does not work.

Please help

John
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines