Limiting Results From An Access Query

I'm attempting to limit a query which is being ordered by a date field to 10 records. The date field contains duplicate values, which are sorted from most recent, back.
However their suggestion of sorting by a secondary field is not providing acceptable results (it returns all the rows in the database). Does anyone have any suggestions of another way around this?

View Replies


ADVERTISEMENT

Asp Search Returns No Results From Access Query

here's what i want to do. from an asp page, perform a search on a
table in access. i have used sql code in the asp page itself, but i'd
rather execute a query in access. i have success in running any query
(basic SELECT, SELECT with conditions _other_ than LIKE, etc..) for
some reason, when i execute the query below from the asp page, i get
no results.

the search.asp page just has a text box in a form that submits the
srchBOX field to the results.asp page.

here's the asp code from the results.asp page: Code:

View Replies View Related

SQL Query Not Returning Results In Access For Dates

I am trying to search through an access database for tickets createded with in a certin date. I am using the below code.

strdate = DateAdd("d", -2, Now())
sqlstr="SELECT * FROM Incidents WHERE TicketDate BETWEEN #"& Now() &"# AND #"& strdate &"# ;"

I verify the query with response.write and get the following.

SELECT * FROM Incidents WHERE TicketDate BETWEEN #15/07/04 19:19:32# AND #13/07/04 19:19:32# ;

I know there are 100% tickets within this date. Yet my query returns nuthing. Please help i've searched this forum for other peoples code looking for examples but end up with the same result.

View Replies View Related

Limiting Data Access

I have 40 different users. Each user manages a subset of the total database. Currently I have a pull-down menu to let the user select their subset and then manage the data within it. I'd like to use their login info to pre-select the subset so that they have access only to their assigned areas. How do I "send" the subset name from one asp page to another? the db is "2004" the table is "Students" .

View Replies View Related

Displaying Results From SQL Query

I'm stuck on trying to display a single row from a query I'm executing.. it was fairly easy in PHP and I'm sure it is in ASP too, I'm just not sure what to code.. I couldn't find anything on the web that was simple.

If anybody has some suggestions on how to display just the one row that is returned from the query that would be great for now. I'm looking to eventually add 'LIKE' to the query to allow for similar names/passwords to be displayed.. but for now this should do. Here's the code:

View Replies View Related

Writing Query Results

I want to write all the query results onto a file so that it is all ready to give to the client.
I am currently writing a query to pull out certain orders in a day and i want to write these results directly to a text file.Also this text file will be obviously placed on the server..is there any way of creating this file on the computer you are accessing this web page on?

View Replies View Related

Presenting Query Results

I need to create asp page witch has a form at top of the page. This is the search form. Then I need to present the search results from database query on the bottom of the page as a table. That table has about dozen columns. Some column values can be modified and saved to the database and some column values has to be modified and saved from another page.

Search table is no problem but I have problems getting the results table to work right... Query results are in recordset.

I need some advice on how to do the results table on the best way!

So far I am thinking on creating a form on every row of results and posting the changes of values to save.asp page where I would save the modifications to database.

For the values witch have to be modified on another page I would add a link something like this... Code:

View Replies View Related

Form Results In Query

How can I get this line to work? I am trying to get the results entered in a form to be part of my query. I am able to get the form results but I get a error stating Syntax error (missing operator) in query expression 'Assignee = Tom Jones'.Below is the line where the error occurs

Session("dbWhere") = "Assignee = " & Request.Form("assignsearch")

View Replies View Related

Multiple Results From One Query

I'm trying to get results from a number of areas via one command string.for example ?location=devon retrieves everything in devon but I've only got a link for the whole south west so I need to send ?location=devon or cornwall or dorset etc. altogether.Is there a way I can do this without changing the asp page or do I have to only search one field at a time.

View Replies View Related

Streaming Query Results

I am working on a classic ASP application. This application needs to run an SQL query and take the result set and stream it into an XCEL spreadsheet for processsing by the users. Is there an ASP method of third party product to do this?

View Replies View Related

Displaying Query Results Per Where Clause

I am trying to design a page that displays data from a query in groups of a field in the where clause and then displays a 'total' per each group. Code:

View Replies View Related

Displaying CrossTab Query Results

Has anyone experience with rendering CrossTab Query results with ASP?

For example, using this SQL:
TRANSFORM Count(threads.threadid) AS CountOfthreadid
SELECT threads.threadSeverity, Count(threads.threadid) AS [Total Of threadid]
FROM threads
GROUP BY threads.threadSeverity
PIVOT threads.threadStatus;

This returns the following in Access:
[threads_Crosstab] [threadSeverity] [Total Of threadid] [Analyzing] [Closed] [Coding] [Open] [Re-Testing]
[Medium ] [1] [1]
[Not Set] [160] [1] [122] [1] [35] [1]

I want to create a HTML table to display the results in my webpage. However, I don't belive the output from a "Transform" is a true recordset. When I request the names of the fields in the recordset, I am getting data from the "rows".

Is there standard way to display these types of queries? How does one access the data in a crosstab query? Are there ojbect classes to handle this?

View Replies View Related

Using ADODB.stream To Get Results From A Url Query

I have an asp page that needs to display the string that is returned from a
cgi file.

As an example, if you enter http://mydomain.com/mycgi.cgi?98127398 in to a
browser, it will display YES or NO

I need to have my asp code query this url, get the resulting string, then
act upon it (basically use the answer to display a nice big tick or a big
cross). Code:

View Replies View Related

Error-checking And Query-results After Execute

After commands like:

tmpDBconn.Execute("DELETE * FROM mytable WHERE rc_id = 10" )
How do I check for errors?
Is there a way to check the results?

OR:

Set rsCatCount = tmpDBconn.Execute("SELECT COUNT(*) FROM cat WHERE key_id = 10 AND cat_id = 6")

How do I get the count? Do I use rsCatCount(0)?

View Replies View Related

Need To Convert This Sql Query For Access To Identical Sql Query For Sql 2005..

My code retrieves a username and a password from a form. Then this information is compared to some usernames and passwords that are stored in a database. The important thing here is that the comparison must be case sensitive meaning that "passWord" is not the same thing as "password"

I have this code, working fine in access 2003

SQL = "SELECT * FROM users WHERE StrComp(username_column,'" & entered_username_in_form & "',0) = 0 AND StrComp(password_column,'" & entered_password_in_form & "',0) = 0"

but get the following error when I run it against my sql 2005 database.

[Microsoft][SQL Native Client][SQL Server]'StrComp' is not a recognized built-in function name.

I don't know the corresponding t-sql for the query.

View Replies View Related

Query Access With Multiple Query

I am using ASP/MS ACCESS to see how I can query the same database, via 2 formfields.

{name: - search}Textfield 1: - Search by Category
AND/OR By
{name: - searchT}Textfield 2: - Location

Currently,

strSearchwords = Trim(Request.QueryString("search")); where "search" is the name of Textfield1

Which is fine, but how can I set it so that on Submit, the string from search, and searchT are somehow joined together into one string?

View Replies View Related

Using ASP To Access Javascript Script Results

I'm wanting to do something and I'm not sure if it's possible (I'd sure
like it to be).

I'm using a neat service called FeedSweep to aggregate a large list of
XML/RSS/ATOM feeds. The FeedSweep works just fine, it takes my request,
chugs and kicks out what it should. The problem is that because I'm
throwing 40 some feeds at it, it takes anywhere from 30 seconds to a
minute+ to kick back the "content." What I want to do (to save my users
from having to wait that time and to keep me from constantly swamping
the FeedSweep servers with these requests) is to use the XMLHTTP
component in ASP to grab the results, save them to a file on my server,
and pull from it (updating once or twice a day).

The problem I'm having is this... FeedSweep generates a Javascript code
for me to place in my webpage, and this code executes and returns the
results (what I want). But, when I try to grab the webpage that
contains this javascript code (link), all I get returned to me is the
"-script src=*link generated from feedsweep*- -/script-" -- What I want
is the actual result content that is generated. (replace the "-" with
greater than/less than signs) Code:

View Replies View Related

Access Results To A Download File

on my asp page i have a list of results pretty much printed out the same way the access database is structured, so its nice n simple. although i want to let users download the results into an excel file or text file.

View Replies View Related

Query Works In Access But Not In Asp->access

What is this all about? Generally I run against SQL Server but now I have to use access. The query I want to run is a simple double join

SELECT tblArtists.*,tblGenres.name AS genreName,tblPages.pageId
FROM (tblArtists
INNER JOIN tblGenres ON tblArtists.genreId = tblGenres.genreId)
LEFT JOIN tblPages ON tblArtists.artistId = tblPages.artistId
ORDER BY surName ASC, firstName ASC

Now If I run this question in access against the database it accurateley returns two posts. BUT When I paste the same query into an asp document and runs it with a fileDSN against the same database it returns nothing!? Is this some kind of joke from Microsoft?

View Replies View Related

Access Query

I'm trying to run an access query with one parameter that is a string. I can call a query that has no parameters. I can also call a query that has one parameter that is an integer. But the one that has a string parameter isn't working.

Here is the code:

[VBS]set rs = conn.execute("getArtists '" & ltr & "'")[/VBS]

I've tried using a command object and it did the same thing. Is there any other way I can get my query to return the records. Running it in access works.

View Replies View Related

Run Access Query

I have a Acces query which creates a table using manipulated data from another table. I want my asp page to run this query after doing an update to the database.

View Replies View Related

Query / MySQL / Access

I've got a query that works fine when used in mySQL but completely fails
when I try to apply it to MS Access, weird thing is that it is just a copy
of a stored procedure that works fine in the same copy (with the
Request.QueryString replaced by a fixed value) ! Any explaination would be
great, ID is a number BTW :

SELECT page_title,ID,page_content FROM content WHERE ID='" &
Request.QueryString("ID") & "' '

Had a look at aspfaq.com but couldn't find anything that applys.

View Replies View Related

Reading Access Query

Is it possible to write an SQL statement that reads from an Access Query instead of an Access Table. If so is the syntax the same as for reading a Table.

View Replies View Related

Execute An Access Query

How can you use ASP code to execute an Access query. I want to run the query to then display updated data on the webpage.

View Replies View Related

Access Query Syntax

Where I found this?

Like this:

SELECT
SELECT TOP N
INTO
FROM
WHERE
GROUP BY
HAVING
UNION (ALL)
ORDER BY
WITH OWNERACCESS
( http://msdn.microsoft.com/library/e.../access2sql.asp )

But with explanations (usage) and samples...

View Replies View Related

ASP Query To Access DB & Remove Dups

I have a field called store, I have more than 1 row with the same store name in the store field.

I need to coolect all the stores from the store field, remove any duplicates, like I might have buy.com twice and only need it to show once in the drop down. And sort ascending (by store name).

Summary.
Database is called: tracker
The table (and the only table) is called merchants
I only want to pull data from the field store, remove duplicate store names, sort ascending.

I can figure out how to plug the required htm around the asp code, to auto populate the drop down.

View Replies View Related

How To Create Or Update A ACCESS Query From Asp

I'm using odbc and Classic ASP and I want to read the sql content of a query in an access database. ANyone have any clues?

View Replies View Related

Using The Like Operation To Query Access Database

I am trying to query an Access database using the like operation; however, when I test the query in the browser all records from the database are displayed. Here is my code:

View Replies View Related

Running Total In Access Query Or Asp

I want to do a running total query , here is what i want :

I want the running total like this:

View Replies View Related

Online Query Analzyer For Access

What is the best way to create new queries and/or modify existing tables within an online access database. At the moment, I am periodically downloading the db and making alterations. But, I have heard others on the list say they use a query analayzer built on
a <form> where they execute SQL statements. Is this the correct way to go?

View Replies View Related

Update Query Works In Access, Not In ASP

I have the following query:

Update properties set Last_Change=#8-Mar-2006# Where properties.fdref='h3c000';

which works fine when I run it on my desktop under MS Access, but when I run it as an ASP page, I get the following error message:

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

I am using the same database bot online and offline so field names etc are exactly the same.

View Replies View Related

ASP Search Using Query In Access Database

I have an Access database that I created a query in. The query brings fields from related tables and prompts users to perform a search based on 3 criterias.

NOTE: the prompts can be bypassed by just leaving it blank and selecting OK. So in other words, the user does not need to fill in each prompt for the search to work, it just give them a more narrowed down search if they fill more in...

Now for the ASP part... I want to create an ASP page where the use selects from 3 drop downs. These drop downs are named the same as the field names in my query. How do I get this to work??

View Replies View Related

Can I Use A Query Stored In An MS Access Database From An ASP Page?

Currently, I do the following in my ASP pages when making use of an MS
Access database:

Dim adoCon, rsSet, strSQL

Set AdoCon = server.CreateObject("ADODB.Connection")
Set RsSet = Server.CreateObject("ADODB.RecordSet")

adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("MyDB.mdb")

strSQL="SELECT * FROM MyTable;"
rsSet.Open strSQL, adoCon
...do some stuff...
rsSet.Close
adoCon.Close

Set rsSet=Nothing
Set adoCon=Nothing

I have a couple queries stored in the database that I use when in MS Access.
Can I call these queries instead of using a string to specify the SQL
command?

The above seems kind of verbose for making use of a database. Can it be
simplified at all?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved