Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2004, 12:03 AM
Registered User
 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default can't display records from Access Table.

I have a table in MS Access shown below. I am able to display the score for quiz_id=1. However, it will not display scores when I attempt to write sql statements (shown below) for 2, 3, and 4. Please advise..

MS ACCESS TABLE:
StudentTable

StudentID quiz_id Score
123456789 1 100
123456789 2 75
123456789 3 45
123456789 4 75

<%
sqltext1 = "SELECT * FROM StudentTable WHERE StudentID='" & Session("username") & "'"
oRS.Open sqltext1, oConn

IF oRS("quiz_id") = "1" Then
Response.Write "" & oRS("Score") & "%" & ""
Else

Response.Write "0"

End If
oRs.Close
%>


</td>
<td width="125" align="center">

<%
sqltext2 = "SELECT * FROM StudentTable WHERE StudentID='" & Session("username") & "'"
oRS.Open sqltext1, oConn

IF oRS("quiz_id") = "2" Then
Response.Write "" & oRS("Score") & "%" & ""
Else

Response.Write "0"

End If
oRs.Close
%>

Repeat for 3 and 4.
The only score that displays is when quiz_id = 1

 
Old April 16th, 2004, 02:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

cross post - see http://p2p.wrox.com/topic.asp?TOPIC_ID=12432 for replies





Similar Threads
Thread Thread Starter Forum Replies Last Post
Display records in a table unmeshraut VB How-To 1 September 21st, 2007 12:04 PM
Access Table Records TonyG Access 7 October 14th, 2005 02:32 AM
Way to display access records using asp.net method ASP.NET 1.0 and 1.1 Basics 4 April 25th, 2005 10:41 AM
copy and append records from table-A to table B bhunter Access 6 March 9th, 2004 02:02 PM
thousands records enter one table to another table mateenmohd SQL Server 2000 3 July 17th, 2003 07:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.