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


ADVERTISEMENT

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

Displaying Results

I am reading information from a sql db and would like for the information to display, which i had working, until i tried making it so that if there was no information in the db field, that it would not display any results. Here is a snippet of the code. Any thoughts.

if name <> "" then
Response.Write("Name: " & recordset("name")& "<br>")
end if

if company <> "" then
Response.Write("Company: " & recordset("company")& "<br>")
end if

if title <> "" then
Response.Write("Title: " & recordset("title")& "<br>")
end if

View Replies View Related

Displaying ASP Search Results Issue

Well I was able to build a simple search page, that would search a database and give the results on the restuls page from the criteria on the search page....

However I am having a issue with the data that's shows in the results. I'm getting the ID Column of the table in stead of the Column with the names. Eg:

<%=(births.Fields.Item("DName").Value)%>

Is there a way to change the data to be displayed to another column?

View Replies View Related

Displaying Results From A Drop Down Option

I am still trying to get my feet wet with ASP, VBScript, and MS SQL here and I am trying to create a very useful page where I can eaisly view my SQL tables and the columns within those tables.

I have two SQL scripts that work well, one to display the tables within my database and one that shows me the column names in that table.

I created a form, added a drop down selection and coded it so the table names appear in the drop down, then added a "Submit" button.

What I am trying to do is get the page to display the column names below based on the table name I select from the drop down list.

ISSUE #1: I cannot seem to get the table name when chosen from the drop down to pass it's value to the second query so it can display the results.

ISSUE #2: How do I display these results from the chosen table name based on the column script below? Code:

View Replies View Related

Adding To Tables Together And Displaying The Results

i run a classified ads site that allows people to post ads, and stores the results in a ms access database.

2 of the imput fields are: price and quantity

What i am trying to do is the following:

To add all the prices and and quantities together and be able to display the results on my site for example my database has the following:

Price | Quantity
2.00 | 300
1,50 | 1
10.00 | 10
140,00 | 7

and on the website i can display the results like so:

Current ads worth: 1681.50

I need the script to ignore letters as in the quantity field people have also added word such as packs and VE ETC so i need it to ignore letters, however in the price field some people have placed the ( , ) sign in there price so the code must recognize ( , and . )

View Replies View Related

Displaying Quiz/test Results On Same Page

I have created a quiz with 14 questions that the user can click a yes radiobutton or no radiobutton. In the code-behind I have set a varable to store the selected items.

What I have taking place is if yesRadiobutton is selected the variable is incremented by 1. then after all the radiobuttons have been added up. i check the variable using an if statement. 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

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 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

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

Displaying Database Query.

I am using MS Sql server and asp pages together.The problem I am getting is not knowing what data type to best set my data to.There is a part # set to nvarchar which seems to work great.

THen an Inductance, currently set as float. My inductance values show as 1.5 and 5, 3, 3.2, etc etc, however I need it to show 5.00 and 3.00, 3.20 etc.the inductance is measured in mH and another column called DCR is measured in Ù. Is there anyway to get this symbol to show in my table on my asp page? or do I need to enter the symbol into the database table?

View Replies View Related

Displaying Images At Random From SQL Query String

I have a database of images with captions that I need to display at random on an ASP page. Once I have pulled out my recordset, what's the best way to select on item at random from the recordset to display? Also, at first I might have only 5 items in my recordset, how can I avoid the same item repeating 3 times in a row if the person clicks refresh?

View Replies View Related

Loop For Displaying Multiple Records From An SQL Query?

I have an ASP page where I want to display the 3 most recent records within a database using a SQL query. The problem is that my page which output the results is only showing the first most recent record and not the two past ones aswell.

Am I right in thinking that might be related to the 'loop' function? I know that my SQL code is fine as I have previewed the results from the code and they are correct. Code:

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 A DB - Pass The Query To Next Page

I am running a querry on an access database and have set the number of records/page displayed at 20. if there are more than 20 records returned, then 1st page will show the first 20, the next page will show next 20 and so on....

The trouble:

the count of total records displayed is correct and the first page is displayed correctly. But when i click on *Next* to go to the next page, all the records of the database get displayed (not the 2nd page of records from 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

ASP LIKE Query Using Parameterized Query

In Access you use "*" + [passed variable] + "*", + can be replaced with &
Calling a parameterized query in Access requires % be used in place of *,
however, all that I have read show dynamic SQL passed to Access:

WHERE [some column] LIKE '" & ASPvar & "' % ORDER BY ...

However, my call is similar to:

conn.qMyLookup strVar, rs

If I modify the query in Access to:

"%" & [passed variable] & "%"

I get all records. If I only put it at the end, as suggested, I only get
matches at the end, not throughout the column. Code:

View Replies View Related

SQL 10 Last Results Only

Anybody know how to get only the 10 latest results of an SQL query ?(in SQL)

View Replies View Related

Stripping Results

i have a record that is returned by the database as domain/username. i want to be able to strip off "domain/" and just display "username". is this possible? if so, how would i go about doing this?

View Replies View Related

Trimming Db Results

i don't know what to do here exactly.
i have seen the TRIM function, but i'm not sure if it's the right way to do it.
i have a recordset called RSUSEREDIT.
in the recordset there is a column called "EMail".
i can print out the results using Code:

<%=RSUSEREDIT("Email")%>

the email column always uses the same domain name... - username@domain.com
is it possible to remove the part after and including the "@"?

View Replies View Related

Results Of URL To File

I have a URL... everything returned by the url, I need to write to a file. lets say its 40 lines of text... how can I write it to a text file and save it??

ADODB stream?
FSO?
DomObject?

View Replies View Related

Seperating Results

I'm creating a site that pulls details from a database & display it on screen. Problem is that there's sometimes loads of data which makes the page huge. What I want it to do is display ten and a next page link to display the next ten. Like the way Google displays results. Problem is I don't know how to generate pages on the fly. So the question is can it be done and does ne1 know how to do it?

View Replies View Related

Filtering Results

First, thanks to all who have helped me over the last few weeks !!
I have a form that allows the user to select multiple options.
These are user names:

Fred S
Bob D
Paul G
Dave O

When the form is submitted, I'm getting the details using

user = request.form("user")

this is returning the mutliple options.
What I would like to do is pass all the options to 'user' but at one
point on the results page only show the first user selected, not the
multiple selection

View Replies View Related

Ordering Results

what is an easy way to go about sorting my search results through links, you know, like clicking the link at the top of a column. i know how to pass the order by in a querystring:

http://www.example.com?lastname=smith&firstname=john&state=GA&orderlast=desc

where orderlast is the order querystring.

but what about all the other links? what do I do with the previous querystring entries like lastname, firstname, and state? i find if i add orderlast to my lastname column and i click on it, i will have 2 orderlast querystrings

View Replies View Related

Recordcount Results

I'm using multiple recordsets on a page, and they are all returning correct results and enough of them. My problem is when I try to access the recordcount property rs.recordcount, they all return a result of -1. This would usually mean that no records are returned. So why is showing my recordsets that are displaying records with recordcounts of -1. I can't seem to figure out.

View Replies View Related







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