Filter Recordset by a Variable - HELP!!
I'm using ASP/VBSCRIPT with an Access database.
I have a variable that contains multiple email address, for
example
Dim Var1
Var1 = [email protected], [email protected],
[email protected]
How do I filter a recordset using that variable. How do I
retrive the records on the database that contain those email
address.
Any one has an asnwer?
Please advise. Thanks!
Will you always know how many variables there are, or will
the number be
dependent on user action?
I'm thinking you should probably have an array, and work
through it to get a
list of variables, the present those to your SQL statement in
an
IF Email == Var1 OR Email = Var2 OR
But I'm not sure how you'll do it if you have a number of
variables you
don't know?
I'll check back in a bit if no solutions have been offered.
"FLEQUE" <[email protected]> wrote in
message
news:eeu92f$8r2$[email protected]..
> I'm using ASP/VBSCRIPT with an Access database.
>
> I have a variable that contains multiple email address,
for example
>
> Dim Var1
> Var1 = [email protected], [email protected],
[email protected]
>
> How do I filter a recordset using that variable. How do
I retrive the
> records
> on the database that contain those email address.
>
> Please advise. Thanks!
>
Similar Messages
-
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? -
Filter recordset with session variable
This has never happened to me before, but for some reason, 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??? What's going on?
PS: I've attached my result page's code to this
message.Gabe the Animator wrote:
> <?php require_once('Connections/sales.php'); ?>
> <?php
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType,
$theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $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;
> }
> }
>
> $colname_rsSales = "-1";
> if (isset($_SESSION['state'])) {
> $colname_rsSales = $_SESSION['state'];
> }
> mysql_select_db($database_sales, $sales);
> $query_rsSales = sprintf("SELECT * FROM sales WHERE city
= %s",
> GetSQLValueString($colname_rsSales, "text"));
> $rsSales = mysql_query($query_rsSales, $sales) or
die(mysql_error());
> $row_rsSales = mysql_fetch_assoc($rsSales);
> $totalRows_rsSales = mysql_num_rows($rsSales);
>
> session_start(); ?>
The issue is that PHP doesn't "work" with session values
until the session has started, and that must be done on each page,
and must be done in the code *above* any reference to a session
variable. The code you posted has the session_start() after it
tries to use the session value ito filter the recordset. So move
this last line of code ( session_start(); ) above $colnam_rsSales =
"-1". Better yet, use:
if(!session_id()){
session_start();
To prevent some versions of PHP from generating a
warning/notice if you've called session_start() on the page already
and you call it again.
Danilo Celic
| Extending Knowledge Daily :
http://CommunityMX.com/
| Adobe Community Expert -
Manage the filter of a caracteristic variable in a dynamic way
Dear expert,
I would like to maintain the values of a filter of a caracteristic variable in the table TVARVC so that the users could modify them as they want. (In my user exit, i will call the variables stocked in the table)
But the problem i have is that it seems impossible to define multiple values for a variable in TVARVC.
Is there anyone who knows this? Or some other solutions to manager a filter or default values of a caracteristic variable ?
Thanks in advance.Hi Jef,
What do you mean by impossible ? The key NUMB of the TVARVC is intended for multiple values (type S for Select-option and a different NUMB for the different values).
Regards,
Fred -
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. -
Filtering a Recordset with session variable
Hi
I am trying to filter a recordset based on a session
variable. The session variable is passed from the login page via a
username which is their email address. This has been successful.
However when I want to filter the users table - tbl_users to
show their first name it doesn't work.
I followed the adobe help tutorial plus ahave tried other
combinations and I am now at a loss on where exactly I am going
wrong.
The recordset is rs_UserAccess
I have a session variable called - MM_Username
The table has 5 records of various users
The code that I have fiddling with is -
<%
Dim rs_UserAccess
Dim rs_UserAccess_numRows
Set rs_UserAccess = Server.CreateObject("ADODB.Recordset")
rs_UserAccess.ActiveConnection = MM_conn_sidecounter_STRING
rs_UserAccess.Source = "SELECT * FROM tbl_users WHERE
username = MM_Username"
rs_UserAccess.CursorType = 0
rs_UserAccess.CursorLocation = 2
rs_UserAccess.LockType = 1
rs_UserAccess.Open()
rs_UserAccess_numRows = 0
%>
Any help would be appreciated. I have outlined below the
different combinations I have tested.
Try No1
rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
= Session("MM_Username")”
Message:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/main.asp, line 182
Try No2
rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
= Session(‘MM_Username’)”
Message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Undefined function
'Session' in expression.
/main.asp, line 186
Try No3
rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
= Session(MM_Username)”
Message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Undefined function
'Session' in expression.
/main.asp, line 186
Try No4
rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
= Session Variable MM_Username"
Message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error
(missing operator) in query expression 'username = Session Variable
MM_Username'.
/main.asp, line 186
Try No5
rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE username
= MM_Username"
Message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Expected 1.
/main.asp, line 186
Thanks in advance
Cheers
DownsyTry this:
rs_UserAccess.Source = "SELECT * FROM tbl_users WHERE
username = " & Session("MM_Username")
Keep that on one line.
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com
"Downsy42" <[email protected]> wrote in
message news:[email protected]...
> Hi
> I am trying to filter a recordset based on a session
variable. The session
> variable is passed from the login page via a username
which is their email
> address. This has been successful.
> However when I want to filter the users table -
tbl_users to show their first
> name it doesn't work.
> I followed the adobe help tutorial plus ahave tried
other combinations and I
> am now at a loss on where exactly I am going wrong.
> The recordset is rs_UserAccess
> I have a session variable called - MM_Username
> The table has 5 records of various users
>
> The code that I have fiddling with is -
>
> <%
> Dim rs_UserAccess
> Dim rs_UserAccess_numRows
>
> Set rs_UserAccess =
Server.CreateObject("ADODB.Recordset")
> rs_UserAccess.ActiveConnection =
MM_conn_sidecounter_STRING
> rs_UserAccess.Source = "SELECT * FROM tbl_users WHERE
username = MM_Username"
> rs_UserAccess.CursorType = 0
> rs_UserAccess.CursorLocation = 2
> rs_UserAccess.LockType = 1
> rs_UserAccess.Open()
>
> rs_UserAccess_numRows = 0
> %>
>
>
>
> Any help would be appreciated. I have outlined below the
different
> combinations I have tested.
>
>
> Try No1
> rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
username =
> Session("MM_Username")?
> Message:
> Microsoft VBScript compilation error '800a0401'
> Expected end of statement
> /main.asp, line 182
>
> Try No2
> rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
username =
> Session(?MM_Username?)?
> Message:
> Microsoft OLE DB Provider for ODBC Drivers error
'80040e14'
> [Microsoft][ODBC Microsoft Access Driver] Undefined
function 'Session' in
> expression.
> /main.asp, line 186
>
> Try No3
> rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
username =
> Session(MM_Username)?
> Message:
> Microsoft OLE DB Provider for ODBC Drivers error
'80040e14'
> [Microsoft][ODBC Microsoft Access Driver] Undefined
function 'Session' in
> expression.
> /main.asp, line 186
>
> Try No4
> rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
username = Session
> Variable MM_Username"
> Message:
> Microsoft OLE DB Provider for ODBC Drivers error
'80040e14'
> [Microsoft][ODBC Microsoft Access Driver] Syntax error
(missing operator) in
> query expression 'username = Session Variable
MM_Username'.
> /main.asp, line 186
>
> Try No5
> rs_UserAccess.Source ="SELECT * FROM tbl_users WHERE
username = MM_Username"
> Message:
> Microsoft OLE DB Provider for ODBC Drivers error
'80040e10'
> [Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 1.
> /main.asp, line 186
>
> Thanks in advance
> Cheers
> Downsy
>
>
> -
Hi,
I m trying to filter an asp recordset with % wildcart but impossible to do it.
Have got a asp form with a dropdown list based on a recordset that stores value (numeric) in a variable (id).
So this variable is used on my result asp page to filter a new recordset by this numeric value.
Im using wild card in order to display all records like this SQL query:
SELECT *
FROM proprietes
WHERE ville LIKE %MMColParam%
MMColParam defined like this :
Numeric
Request.Form("ville")
default value %
So when it generates sql query, it gives SELECT *FROM proprietes WHERE ville LIKE '%MMColParam%' and testing it, it works (testing recordset in dream) but saving it and reopens recordset the query becomes : SELECT *FROM proprietes WHERE ville LIKE %MMColParam% and testing recordset gives error !!
Someone can help me?
Thanks a lot.Hi thanks a lot
Here my asp form :
Request form "ville" value is coming from access database and is a numeric value (autoid) wich is used to filer recordset on results page.
I done this type of fiter several times with other version of dreamweaver but with CS4 impossible to do it (or i missed something!!)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/immo.asp" -->
<%
Dim local
Dim local_cmd
Dim local_numRows
Set local_cmd = Server.CreateObject ("ADODB.Command")
local_cmd.ActiveConnection = MM_immo_STRING
local_cmd.CommandText = "SELECT * FROM villes"
local_cmd.Prepared = true
Set local = local_cmd.Execute
local_numRows = 0
%>
<!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>Document sans titre</title>
</head>
<body>
<p> </p>
<p> </p>
<form id="form1" name="form1" method="post" action="resultats3.asp">
<p> </p>
<p>
<label>
<select name="ville" id="ville">
<option value="%" <%If (Not isNull((local.Fields.Item("idville").Value))) Then If ("%" = CStr((local.Fields.Item("idville").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Indifférent</option>
<%
While (NOT local.EOF)
%>
<option value="<%=(local.Fields.Item("idville").Value)%>" <%If (Not isNull((local.Fields.Item("idville").Value))) Then If (CStr(local.Fields.Item("idville").Value) = CStr((local.Fields.Item("idville").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(local.Fields.Item("ville").Value)%></option>
<%
local.MoveNext()
Wend
If (local.CursorType > 0) Then
local.MoveFirst
Else
local.Requery
End If
%>
</select>
</label>
</p>
<p> </p>
<p> </p>
<p>
<label>
<input type="submit" name="button" id="button" value="Envoyer" />
</label>
</p>
</form>
<p> </p>
<p> </p>
</body>
</html>
<%
local.Close()
Set local = Nothing
%>
Here my asp results page:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/immo.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "%"
If (Request.Form("ville") <> "") Then
Recordset1__MMColParam = Request.Form("ville")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_immo_STRING
Recordset1_cmd.CommandText = "SELECT * FROM proprietes WHERE ville Like ?"
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
%>
<!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>Document sans titre</title>
</head>
<body>
<p><br />
<%
response.write(request.form("ville"))%>
<br />
<br />
SELECT * <br />
FROM proprietes<br />
WHERE ville LIKE '%vil%'
</p>
<p> </p>
<p><br />
<br />
</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%> -
Filter view with session variable does not display value properly.
Hi All,
I have a very unique issue and I am not sure if anyone ran into this before.
I have a prompt in my dashboard and a link to a report. The session variable default the value to the current value (term)
when I click the link to the report I get the following value, on the filter view of the report: Term Code Desc is equal to NQ_SESSION.CSA_Analysis_Term
however if I click the go button in the prompt I get the value: Term Code Desc is equal to 2030 (2011 Spring)
does anyone have a solution to this issue
thanksHello,
Have the same issue. Any solution. Gurus plz help.
thanks,
deep -
Filtering recordset with session variable
This has never happened to me before, but for some reason, 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??? What's going on?
PS: I've attached my result page's code to this
message.Actually, problem solved. I moved " session_start()" above
"$colname_rsSales = "-1" ", which did the trick. -
Using MS SQL and ASP VBScript. I have a table called
PRODUCTS, in this table there is a field called CATEGORIES. now the
CATEGORIES field contains comma separated values representing each
category it belongs to ie: 2,5,10,12. So in this example there are
4 categories this product belongs to. Now I need to filter a
recordset by category based on a single variable.
So if I click my link: mypage.asp?CatID=2, it should return
all the records that have 2 in the CATEGORIES field.
I tried using the % wildcard but it would return 2, 12, 20,
basically anything with a 2 in it which is not what I am looking
for.
SELECT *
FROM PRODUCTS
WHERE CategoryID .......This is where I can't get it working.
any suggestions?bump
-
Settings in Variables help input (F4) in Web
NetWeaver 7.0 -> Stack 13
Hi,
When you select a value in a Query with the help input (F4), you have a settings menu to select the display (key, text, key and text...) or add some attributes in your value list.
These settings are available in:
- BEX analyser in the variable screen (before query execution)
- BEX analyser in the select filter value (after query execution)
- Web portal in the select filter value (after query execution)
But not available in:
- Web portal in the variable screen (before query execution).
You know why ? Have I missing a parameter in the WAD ? Is it planned in next Support package ?
Thanks you for your help.
NicolasDid you ever figure this out? We are having the same problem...
-
Creating query filter from a created variable
Hi,
On my report, I am using two of my measures to derive a text message in a third column, which is a list of exceptions, so it is a finite list, which will be displayed on the screen.
I want to create a filter in the query that allows me to filter the results for the third column, allowing me to select a list of values of what I want. Is this possible?
The closest I've gotten is a report filter (which is not at the query level) and even then, the list of finite values has not populated automatically, I need to type the values that I want in the report. This is not optimal, as other users of the system will not have any knowledge of what possible values there are, so I need it to display the different possible variable values to filter on as a list, rather than free standing text.
Can anyone help me with my problem? ThanksJohn responded to our hiring ad, but didnt give us everything we asked for, he only gave us our keywords, & he seemed so sincere saying they were down to earth, great at customer service, etc., so I sincerely told him its too bad he didnt give us all we asked for. I wasnt being sarcastic, I was simple stating my disappointment.
http://reviewsoffreelancers.com/2008/04/30/graphic-web-designer-john-zagurasky/ -
Filter recordset with results of another?
Can you filter a recordset with the results of a field from a
proceeding recordset in PHP?Manually setup a variable in between your recordsets in your
head.
$var = $row_firstRecordset['Fieldname'];
Second recordset, just use your $var name to filter.
HTH,
Jon
"tccdover" <[email protected]> wrote in
message
news:eaoha0$pcb$[email protected]..
> Can you filter a recordset with the results of a field
from a proceeding
> recordset in PHP? -
Can I reference presentation variable on some column. That column is some calculation....
please need urgent helpYou cannot use another presentation variable to use the Results of the column. If the results of that column are needed to pass to another report then you can simply use report navigation or if you need to filter another report based on this column results that you need to use Advanced filter option "Filter results based on another request" condition.
If you need to pass the results of the column say only one data set instead of entire rows in that column then use Go URL. That is a very good blog explain in and out of Go URL.
http://gerardnico.com/wiki/dat/obiee/presentation_service/obiee_url_passing_filters
Hope it helps
Thanks
Prash -
Filter recordset between dates
Hi all...
I'm trying to filter a recordset on two dates using 'between' in my sql
I'm getting nowhere with it.
I'm using Dreamweaver 8.2 and access database.
Here is my code:
<%
Dim RSReport1__param1
RSReport1__param1 = "01-01-2000"
If (Request("reportfrom") <> "") Then
RSReport1__param1 = Request("reportfrom")
End If
%>
<%
Dim RSReport1__param2
RSReport1__param2 = "01-01-2000"
If (Request("reportto") <> "") Then
RSReport1__param2 = Request("reportto")
End If
%>
<%
Dim RSReport1
Dim RSReport1_cmd
Dim RSReport1_numRows
Set RSReport1_cmd = Server.CreateObject ("ADODB.Command")
RSReport1_cmd.ActiveConnection = MM_myconn_STRING
RSReport1_cmd.CommandText = "SELECT Count(Actions.ActionID) AS CountOfActionID, Actions.Department, ActionSource.SourceOfAction FROM ActionSource INNER JOIN (Actions INNER JOIN Department ON Actions.Department = Department.Department) ON ActionSource.SourceOfAction = Actions.SourceOfAction WHERE (((Actions.Date_Raised) Between #?# And #?#)) GROUP BY Actions.Department, ActionSource.SourceOfAction ORDER BY Actions.Department;"
RSReport1_cmd.Prepared = true
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param1", 135, 1, -1, RSReport1__param1) ' adDBTimeStamp
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param2", 135, 1, -1, RSReport1__param2) ' adDBTimeStamp
Set RSReport1 = RSReport1_cmd.Execute
RSReport1_numRows = 0
%>
No matter what i do, i just can't get the recordset to work.
Any ideas before i pull my teeth out???
I've also tried
<%
Dim RSReport1__param1
RSReport1__param1 = "01-01-2000"
If (Request("reportfrom") <> "") Then
RSReport1__param1 = Request("reportfrom")
End If
%>
<%
Dim RSReport1__param2
RSReport1__param2 = "01-01-2000"
If (Request("reportto") <> "") Then
RSReport1__param2 = Request("reportto")
End If
%>
<%
Dim RSReport1
Dim RSReport1_cmd
Dim RSReport1_numRows
Set RSReport1_cmd = Server.CreateObject ("ADODB.Command")
RSReport1_cmd.ActiveConnection = MM_myconn_STRING
RSReport1_cmd.CommandText = "SELECT Count(Actions.ActionID) AS CountOfActionID, Actions.Department, ActionSource.SourceOfAction FROM ActionSource INNER JOIN (Actions INNER JOIN Department ON Actions.Department = Department.Department) ON ActionSource.SourceOfAction = Actions.SourceOfAction WHERE (((Actions.Date_Raised) Between ? And ?)) GROUP BY Actions.Department, ActionSource.SourceOfAction ORDER BY Actions.Department;"
RSReport1_cmd.Prepared = true
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param1", 135, 1, -1, RSReport1__param1) ' adDBTimeStamp
RSReport1_cmd.Parameters.Append RSReport1_cmd.CreateParameter("param2", 135, 1, -1, RSReport1__param2) ' adDBTimeStamp
Set RSReport1 = RSReport1_cmd.Execute
RSReport1_numRows = 0
%>
But get this error:
Datatype mismatch in criteria expression
Help Please!!!
AndyThanks bregent
I changed the type to 133 and the code is working now.
I still get the error in the Dreamweaver dialog box when i test the recordset, but the code works...
Thanks again
Andy
Maybe you are looking for
-
HP 5510 wil not print in black ink after installing a new black ink cartridge
My HP 5510 printer will not print in black ink after installing an official HP black ink cartridge. I see other people have had the same problem. I have gone through all the troubleshooting suggestions. I would like to know if anyone has been abl
-
i foolishly copied my existing itunes folder from c: drive to an external hard drive.and then even more foolishly deleted the old itunes folder from the c: drive, as needed more space. sadly now when i open itunes, i can see all the tracks, playlists
-
I can't open a file in OS 922 that was created in OS X.
The web-pages I downloaded while in OS X (and stored in the HD) appear blank, (white, no logo) when I am booted in OS 922. When I try to open them, I receive a message "Sorry, could not open because the application that created it could not be found"
-
I take my mini tapes to a company which they make into DVD's. I would like to edit them into iMovies. Which ripping software (preferably free) should I use. Please help.
-
Any default sound boards in Flash 8?
I want to have a simple MP3 play on my site when I open the page. I want the MP3 to have a sound board attached to it though with play, stop, pause, volume, etc... Are there any of these built into Flash 8 or is there a place I can download one inste