How to filter a recordset using a combo (ASP)
Hi.
I have my website in ASP linked to an Access database using DSN. It is working ok.
I need some help to make a filter in a recordset, but the filter is a combo box that any time that a value is choosed the data int he grid/table is also changed.
Here it is my code:
SELECT *
FROM qry_YTD
WHERE DirMan = MMColParam
ORDER BY id_fy DESC, tot desc
Please somebody help me.
Regards,
Marco
[Moved by moderator to the appropriate forum]
Hi,
Thanks for your reply.
I don't really know how to do it.
Please explain me how to do it.
Thanks,
Marco
Similar Messages
-
How do i add recordsets to a .dwt.asp-generated page
help - i am at wits end.....
below is code for a page (test3.asp) based on a template
called "catalogue.dwt.asp". i need various recordsets on various
pages based on this template. f i try to add a recordset to
test3.asp, i'm told "making this change would involve changing cose
that is locked by a template or translator" - so i cant add the
recordsets (tho interestingly you can see that i did manage to
somehow add two recordsets at the outset before it started saying
this.
if i try to add the recordsets to the template (which is not
the way i want to do it anyway), i'm told i've added code outside
the html tag and wont be copied unless i add
<!--TemplateInfoOutsideHTMLIsLocked-->
i have bvuilt plenty of other sites where i DONT have this
issue so DW/me must be coding something different sometimes -
bottom line is - how do i get to having a .dwt.asp temaplte which i
can build other pages from, and then add relevant recordsets to.
i would be DEARLY GRATEFUL for anyone who can help me put
this perennial problem to bed.
thanks in advance:
Code attachedFunny, I have never seen anyone report this. And I've worked
with DW and
recordsets in template child pages for a mightly long time,
and never
experienced it. On the other hand, it's always a good idea to
restart your
system when things like this happen. You never know what
could be
interfering.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Ed Stewart" <[email protected]> wrote in message
news:fe80k0$4tb$[email protected]..
>> below is code for a page (test3.asp) based on a
template called
>> "catalogue.dwt.asp". i need various recordsets on
various pages based on
>> this
>> template. f i try to add a recordset to test3.asp,
i'm told "making this
>> change
>> would involve changing cose that is locked by a
template or translator" -
>> so i
>> cant add the recordsets (tho interestingly you can
see that i did manage
>> to
>> somehow add two recordsets at the outset before it
started saying this.
>>
>> if i try to add the recordsets to the template
(which is not the way i
>> want to
>> do it anyway), i'm told i've added code outside the
html tag and wont be
>> copied
>> unless i add
<!--TemplateInfoOutsideHTMLIsLocked-->
>>
>> i have bvuilt plenty of other sites where i DONT
have this issue so DW/me
>> must
>> be coding something different sometimes - bottom
line is - how do i get
>> to
>> having a .dwt.asp temaplte which i can build other
pages from, and then
>> add
>> relevant recordsets to.
>>
>> i would be DEARLY GRATEFUL for anyone who can help
me put this perennial
>> problem to bed.
>
>
>
>
> It's a bug. Close and re-open DW and your templated page
will accept the
> RS without squawking. -
Alternate method to writing filter for recordset using session variable
I'm not sure if this can be done. I have a user page which I'd like to return database info based upon a userid entered on another page. So far, the session variable (userid) is captured on the user page however it is supposed to return the user's name rather than displaying the session variable.
My problem is this. Within dreamweaver, I am able to create recordsets however I cannot create a filter. The connection works. At this point, I am searching for a workaround where I can tie in the session variable to recordsets. I should make mention that whenever I update the sql statement using the recordset widget, my recordset disappears. ? At any rate, heres a sample of the code sans connection strings, etc.
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_newuniversity1_STRING
Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid = '" & Session("userid_my") & "'"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
On the user page, I have a 'Welcome' and the following code
{Request.userid_my}
Any suggestions? I'm afraid I'm a newbie to asp within dreamweaver cs3.>When I insert request.userid_my code it returns the session variable
AFAIK, session variables are not part of the request object - so I do not understand why you are referencing them this way. I would use the standard reference method : Welcome <%Response.Write(Session("username"))%>
>when I insert the recordset associated with 'name' I get an Adobe End of file error. ?
Sounds like a possible problem with your installation. You may need to try reinstalling DW. How are you "inserting" this recordset and when does the error occur?
Regarding your next post...
>select name from table_name where userid = '" & namemy & "'"
>The statement consistently returns a 'quoted string not properly terminated' error.....
The select statement you quoted is obviously not complete. If you are refering to the select in your OP:
Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid = '" & Session("userid_my") & "'"
I see nothing wrong with that syntax and the string appears to be terminated correctly. If there is a different statement causing the error, please post the entire line and include a line above and below. -
Unable to filter a recordset using a session variable
I have a volunteer application page and when the volunteer presses <Submit> their info is saved in a MySQl db table and a session variable is created containing the primary key of their record in the table, control is then passed to a "success page". The success page can access the session variable (I proved this by displaying the session variable on the success page) so my next step was to create a recordset in the success page with a filter using the session variable to select the appropriate row in the table, allowing me to display to the volunteer the info they submitted.
I set up a test success page which displays the session variable and one field of the volunteer info. When I test this I see the session variable displayed but the corresponding volunteer info field from the recordset is not displayed.
The volunteer application page is here www.hollisterairshow.com/volunteerapp.php and the successpage is here www.hollisterairshow.com/thanksvol.php
The code that creates the session variable in the volunteer application page is shown below
$_SESSION['volunteer_id'] = mysql_insert_id();
The code to display the session variable in the success page is shown below
<?php echo $_SESSION['volunteer_id']; ?>
The code to display the volunteer info is shown below
<h1> Thank You <?php echo $row_rsVolunteerApp['firstname']; ?>!! </h1>
The recordset definition is shown below
The success page test result is shown below, as you can see the volunteer's first name is not displayed immediately after the "Thank you" message but the session variable holding the correct primary key (41) is shown correctly.
Does anyone have an idea of what I'm doing wrong?
Thanks
TonyWhere did you put session_start()? It needs to be before the variable is accessed. It's obviously before the line that displays the value in your page, but is it before the SQL query is generated?
Also, have you checked in phpMyAdmin to see whether volunteernumber 41 has any values in the database? -
How to filter Groupwise records using custom fields?
I am consuming the Groupwise web service and want to search
the appointments based on value provided for a custom field. All
the other searches (date, subject, message) are working fine. The
only thing that does not work is search on the custom field. If I
search on the Custom field the service returns all records.
Following is the excerpt of the code. CFGWID is the field
that is sent to groupwise with an application generated value. I am
able to query the field but cannot filter appointments using the
CFGWID field.
<filter>
<elements type="FilterGroup">
<element type="FilterEntry">
<op xsi:type="xsd:string">eq</op>
<custom xsi:type="xsd:custom">cfgwid</custom>
<value
xsi:type="xsd:string">#arguments.AppMsgID#</value>
</element>
</elements>
</filter>
At this time there is only one entry in this filter. Any
ideas?PS0510 wrote:
> I am consuming the Groupwise web service
First of all, "Groupwise web service"!? Please tell me more
about this.
I use Groupwise here and this sounds like an interesting
feature!
> and want to search the appointments based on value
provided for a custom field.
How are you searching the custom field? Are you accounting
for the name
space xsi: and xsd: values? There is a bit of quirkiness with
CFML xml
functionality when working with name spaces. I've always been
able to
work out these issues with a bit of Google searching. -
HOW TO FILTER DIM VALUES USING LEVEL PARAMETER SCREEN BEFORE PRESENTATION
hello,
sorry but i did not understand your question - i don't know which objects is
the "Descriptor". Let me try to update you with some facts and a better example
of the situation - i will be also uploading some screen shots.
from the jdeveloper help we found the topic "Specifying the action for a step
object" which is very similar to what we want to perform. here follows the text
and also some comments from us:
Example: Using step actions Assume that a selection consists of the following
two steps:
Step A specifies the members: Boston, Chicago, and Denver
(comment: in our problem, step A is a selection of customers performed using
one of the 2 hierarchies of Customer dimension)
Step B specifies the members: Boston and Austin
(comment: in our problem, step B is another selection of customers performed
using the other hierarchy of Customer dimension)
Step B follows Step A.
The following list shows how the results of this selection differ depending
on the action that is
specified for Step B:
Step B action: SELECT -- Result: Boston and Austin (that is, only B is
included)
Step B action: ADD -- Result: Boston, Chicago, Denver, and Austin (that is,
the union of A and B is included)
Step B action: KEEP -- Result: Boston (that is, only members that are common
to both A and B are kept; also referred to as the intersection of A and B)
(comment: This is what we expect to have - the intersection of both customer
dimension selections goes to the row edge of the presentation)
Step B action: REMOVE -- Result: Chicago and Denver (that is, any members in
B are removed from the current selection )
how do i obtain this intersection ? is it possible to use this selection
combining both hierarchies ?
Please refer to the screen i will upload - it is the filter we need to apply.
the customer dimension has 2 levels above the leaf records in one hierarchy,
called "SETOR" and "ROTA" , and 3 levels in the other hierarchy, called
"SEGMENTO" , "CANAL" and "SUBCANAL"
thanks in advanceHi Prasad,
I got your note, you should not use Session variable syntax to call presentation variable.
you should use like @{AIC_PROJ_PLAT_SEQ_NO}
One more thing: first test the variable AIC_PROJ_PLAT_SEQ_NO value then try to pass to SP.
Hope this helps -
How to filter change pointers using BADI - BDCP_BEFORE_WRITE?
Hi,
We have a scenario where due to various loads lot of change pointers are getting generated. Now I want to delete the unwanted change pointers based on some condition.
Through this forum I figured out that we can use the BADI -> BDCP_BEFORE_WRITE and create an implementation in it to clear the change pointers based on our conditions.
But could anyone please tell me when does this BADI gets triggered? I tried various options by putting a break point in the implementation, in CHANGE_POINTERS_CREATE function module etc but couldnu2019t see my BADI getting called or triggered.
I have my code placed in the implementation of this BADI but doesnu2019t have any clue when it gets called. I assume being this a standard filter BADI it should be called of itu2019s own but how can I check whether my code works or not. Wonu2019t there be any Transaction code which when executed will trigger this BADI. Any help on this will be appreciated.
Thanks.Thanks again Amit. But still my question is at what event this BADI gets triggered.
Let me explain the code I have written.
LOOP AT change_pointers INTO lv_bdcpv.
lv_tabix = sy-tabix.
ws_c_objid = lv_bdcpv-cdobjid(18).
SELECT SINGLE cuobj klart obtab objek INTO t_inob FROM inob
WHERE cuobj = ws_c_objid AND
obtab NE 'KNA1' .
IF sy-subrc = 0.
DELETE change_pointers INDEX lv_tabix.
ENDIF.
ENDLOOP.
This is the code written so that I can get rid of all the change pointers that are written which are not relevant to Customer.
But I want to know how this BADI gets executed, at what event or at by which TCODE or program?? I tried to change some classification data and and it created entry in BDCPV but are not related to customer. So how can I get this BADI executed so that it deletes the entry from BDCPV table?
When I check the BDCPV table the entries are still there as unprocessed.
Hope I am clear with my question. Any help will be appretiated.
Thanks, -
How to filter in URL using NW04s WAD?
Greeting Web Template Gurus,
I am working in NW04s SP12 WAD (Web Application Designer) and I am trying to use the filtering criteria in my URL... <bwurl>&FILTER_IOBJNM=0PLANT&FILTER_VALUE=1000. I have brought in the Filter Pane in the Web template and when I run the Web Template in IE, I do not see where 0PLANT is being used.
Is there a setting in the Web Template I am missing, or a specific Command I need to be running to get this to work for me?
Regards,
AlexHello Alex,
Please try to pass the command using the Template ID and not using the Query,
for example
http://<server><port>/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=MMFG_M03_Q0088&FILTER_IOBJNM_1=MPLANT&FILTER_VALUE_1=3010
instead of using QUERY=MMFG_M03_Q0088, try WebTemplate as given below, it may help you
http://<server><port>/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?template_id=yourTemplate&FILTER_IOBJNM_1=MPLANT&FILTER_VALUE_1=3010
See this page for more info
[Calling Parameterized Web Templates|http://help.sap.com/saphelp_nw04/helpdata/en/27/6c013a53271a05e10000000a11402f/content.htm]
Thanks
Chandran -
How to filter datagridview by using DatetimePicker
Hi all I have a gridview and some data in it ,but I want to filter by date I have startTime and EndTime which are thesame, ideally I would like user to click on say 04/05/2015 items for that day shows up ,but I have been struggling with it now can get it
to suit my purpose, find below is my Datetimepicker method Please note I am using an access DB to retrieve data.,what are my doing wrong thanks in advance?
string strSql = String.Format("SELECT * FROM Computers WHERE StartTime >= #{0:MM/dd/yy hh:mm}# AND EndTime <=#{0:MM/dd/yy hh:mm}#", dt.ToString("MM/dd/yy hh:mm"));
Lukaas NjieIs your Datagridview using a DataTable as the source. It would be easier to filter the datatable. Is the data a string object or a datetime object?
You string statement should look like the following
string strSql = String.Format("SELECT * FROM Computers WHERE StartTime >= #{0}# AND EndTime <=#{0}#", dt.ToString("MM/dd/yy hh:mm"));
{0} is the first parameter which is already a string : dt.ToString("MM/dd/yy hh:mm")
jdweng -
How to filter a table using column filter on a date field with time?
Hi,
I have a date field where I am inserting a date+time value, for example: 01/01/2012 09:30:00 So, I would like to filter an adf table using a column inputdate filter to filter only by date this field.
I was testing using formats but with no luck.
Any Idea?
Thanks,
jdev 11.1.2.3
Edited by: jhon.carrillo on Oct 29, 2012 12:23 AMThen, try to add another attribute in your SELECT VO statement, which truncates the original date_and_time field:
SELECT.... TRUNC(DATE_AND_TIME) as truncated_dateAfter that, put reference to that attribute in the filter facet, as follows
<f:facet name="filter">
<af:inputDate value="#{vs.filterCriteria.TruncatedDate}" id=.../>
</facet>Do not forget to add the TruncatedDate attribute in the <tree...> binding in the pageDef, along with others VO attributes. Do that manually. -
How to filter complex data using pl/sql
Hello,
i have to filter some data from the table with 1millions rows in it.
here the requirement
for example table is TEST
id type
1 a
1 a
1 b
2 c
33 b
33 b
33 c
33 d
5 c
5 c
now i just want to display the results which contains type c only if id is with also connected other than c than i dont want to dislplay that results
so my result will look like .here i dont want to disply id 33 because some the id with 33 are connected with type other than c.
id type
2 c
5 c
so can please give me idea to make a query on that table
thanks in advancewith t as (
select 1 id,'a' type_cd from dual union all
select 1 id,'a' type_cd from dual union all
select 1 id,'b' type_cd from dual union all
select 2 id,'c' type_cd from dual union all
select 33 id,'b' type_cd from dual union all
select 33 id,'b' type_cd from dual union all
select 33 id,'c' type_cd from dual union all
select 33 id,'d' type_cd from dual union all
select 5 id,'c' type_cd from dual union all
select 5 id,'c' type_cd from dual
select id,
type_cd
from (
select id,
type_cd,
count(distinct type_cd) over(partition by id) cnt,
row_number() over(partition by id,type_cd order by 1) rn
from t
where type_cd = 'c'
and cnt = 1
and rn = 1
ID T
2 c
5 c
SQL>SY. -
How to filter values using presentation varible if it is using a multiselec
Hi Gurus,
Could you pls suggest me here.
I have a requirement like my OBIEE 10G version report is not filtering the values when we select any value in Dashboard prompt.
I tried to create a presentation varible in prompt for filtering but for prompt under control it is given an MULTI SELECT.
i need to filter the values .now though we select any value in prompt ,it is not picking any value.
How to filter the values using MULTI SELECT Here.Please suggest me here .
Regards,
SKHi User,
In, the physical layer go that column and change datatype from double to int and save the rpd.
This should resolve your issue.
Even, it is not required to modify or use cast function to change datatype.
Else,
Change the datatype of column in the Business layer.
This should resolve your issue.
Assign some points if this helps you :) -
I am having the same problem as user "Gabe the animator" in a post sent in 2007.
"my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
here is the code:
<?php require_once('Connections/mockconn.php'); ?>
<?php
session_start();
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
if(!session_id()){
session_start();
$colname_info = "-1";
if (isset($_SESSION['email'])) {
$colname_info = $_SESSION['email'];
mysql_select_db($database_mockconn, $mockconn);
$query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
$info = mysql_query($query_info, $mockconn) or die(mysql_error());
$row_info = mysql_fetch_assoc($info);
$totalRows_info = mysql_num_rows($info);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>home</title>
</head>
<body>
<div id="info">hello <?php echo $row_info['']; ?></div>
<?php
if (isset($_SESSION['email'])) {
echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
?>
</body>
</html>
PLEASE PLEASE HELP.... I have been at this for day's...
how do I get the record set to filter based on the value of the session variableSorry I forgot to mension the error I am getting?
( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
Call Stack
Time
Memory
Function
Location
1
0.0093
389024
{main}( )
..\home.php:0
Why is this error coming up? -
How to display "All Items" using a "Filtered Rows" Combo Box
Hi
How do I make a Combo Box with "Filtered Rows" show "All Values" by default, AND have the option to select individual filters?
If my data was
North
South
East
West
I would want the Combo box to display
ALL
North
South
East
West
When the user selected:
North, they should see just the filtered rows with North
South, they should see just the filtered rows with South
ALL should be the default, and it should ifilter/include North, Soutn, East and West (i.e. showing all the rows)
I need to use a Combo box and Filtered Rows, because I actually want to filter my dataset using multiple columns:
Company, Region, District, Sector, Value
My current method is to:
use a Combo to filter the RawData on Company into an Intermediate_Company worksheet
use another Combo to filter the Intermediate_Company worksheet on Region into an Intermediate_Region worksheet
use another Combo to filter the Intermediate_Region worksheet on District into an Intermediate_District worksheet
use another Combo to filter the Intermediate_District worksheet on Sector into an Intermediate_Sector worksheet
then display in a List View from the Intermediate_Sector worksheet.
Any comments on this method would also be welcome.
Thanks for your help
StuartThanks Muwa
I've uploaded a non-working version here: http://www.teradepot.com/ntxgoo6629zi/Simple_All_Combo.xlf.html
I've figured out how to use tthe filter to copy a subset of the rows in the source date to the destination are of the worksheet.
I can't figure out how to use a filter to copy ALL the rows in the source to the destination.
I've seen hints about using hidden filters, but I can't make this work, either. It's quite depressing, really
I'm very grateful for any help you can give.
Thanks in advance
Stuart -
How to use the Combo Box In MAtrix Colums
HI Experts,
Good Mornong.How to use the Combo Box In MAtrix Colums?
Regards And Thanks,
M.Thippa Reddyhi,
loading data in to the combobox on form load.but, it should be done when atleast one row is active.
the values what ever you are inserting in to combo should be less than or eqhal to 100 or 150.if it exceeds beyond that performance issue arises.it takes more time to load all the data.so, it is better to have 100 or less.
oMatrix.AddRow()
RS = Nothing
RS = ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
RS.DoQuery("select ItemCode,ItemName from oitm")
oCombo = oMatrix.Columns.Item("ColumnUID").Cells.Item(oMatrix.RowCount).Specific
For i = 1 To RS.RecordCount
If RS.EoF = False Then
oCombo.ValidValues.Add(RS.Fields.Item("ItemCode").Value,RS.Fields.Item("ItemName").Value)
RS.MoveNext()
End If
Next
the above code is inserting data from database to column combobox.
you can fill combo directly also as shown below.
oCombo.ValidValues.Add("x","1")
oCombo.ValidValues.Add("y","2")
oCombo.ValidValues.Add("z","3")
oCombo.ValidValues.Add("","")
and what ever the values you are filling into combo should be unique.other wise it shows valid value exists.
regards,
varma
Maybe you are looking for
-
Pdf extension changes to .dat when send a file via e-mail from adobe acrobat 9
to convert a file from microsoft word 2007 to PDF and send as an attachment via e-mail from adobe 9, the file is received with the extension changed to. dat, so recipients can not open it. Can anyone help me with this.
-
Issue with Date showing Null in interactive report
I created an interactive report for a customer and was confused to see blanks or more specifically dashes where there should be dates in one of the fields. I knew this field should have data so I did some testing and this is what I have found: The sq
-
Power Mac G4 keeps crashing. Start up after restarted
Hello. This Power Mac G4- AGP graphic - keeps crashing. However, after each crash it power up normally. The problem reoccurred several time over a week. I am happy with this computer and i would like to keep it if possible.So here is the log file. Un
-
Flash Player in Windows 8.1 64 bit problems .....
Hi. I have just installed Windows 8.1, but have problems with the embedded Flash Player in Internet Explorer. Starting Internet Explorer from the Desktop causes no problems. In particular (in case this has any bearing), going to BBC.co.uk, Sport,Form
-
Hi Guys, I'm wondering how can I block a sales order on item/header level under following cirucmstances: 3 groups of material (1,2,3) existing in the system, they are using the same order type Automatic block of sales order should be done only for ma