View Single Post
Old 02-04-2011, 04:48 PM   #1
tugagirl
 
Join Date: Feb 2011
Posts: 1
Default Problem with filter database

Hi!!!

I'm a beginner on dreamweaver and I think I'm doing something wrong...

I have a access database, which I made the connections to the .asp vbscript page and after that I made the recordset and applied a filter, I click on Test which ask me to provide the test value, I enter a test value and I can conclude that the filter is working fine, because it gives me the correct record(s).

I add the table and the respective bindings and the repeat region. I Save the document but when I go to the localhost the filter doesn't work, it only gives me one record and is always the same record (for example I want the record(s) of value 2, but instead it gives me the record of value 1).

I really cant understant what I'm doing wrong because when I execute the test on the respective recordset, everything works fine.

I forgot something or it is a bug?

The code: (the filter I'm referring Its on recorset2)
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"
%>
<!--#include file="Connections/conbd.asp" -->

<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then 
  Recordset1__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_conbd_STRING
Recordset1_cmd.CommandText = "SELECT * FROM filmes WHERE ID = ?" 
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5, 1, -1, Recordset1__MMColParam) ' adDouble

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "1"
If (Request.QueryString("id_filme") <> "") Then 
  Recordset2__MMColParam = Request.QueryString("id_filme")
End If
%>
<%
Dim Recordset2
Dim Recordset2_cmd
Dim Recordset2_numRows

Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
Recordset2_cmd.ActiveConnection = MM_conbd_STRING
Recordset2_cmd.CommandText = "SELECT * FROM comentarios WHERE id_filme = ?" 
Recordset2_cmd.Prepared = true
Recordset2_cmd.Parameters.Append Recordset2_cmd.CreateParameter("param1", 5, 1, -1, Recordset2__MMColParam) ' adDouble

Set Recordset2 = Recordset2_cmd.Execute
Recordset2_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
tugagirl is offline   Reply With Quote