Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 28th, 2004, 11:37 AM
ProEdge's Avatar
ProEdge ProEdge is offline
Contributing User
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2004
Location: Somewhere I belong
Posts: 1,557 ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 34 m 55 sec
Reputation Power: 39
Displaying next record from database

Hello everyone. I recently created an Access database which contains several columns of information. I've created asp files that extract the information from my Access database and place them into my asp file. However, I've discovered that making asp files for each row (or ID number) is very tedious and can be a pain when it comes to adding something new (such as a new column) because I have to go back and add the new column into each asp file. The following is the code of the first asp file:

<% @ LANGUAGE = VBScript %>
<% Option Explicit %>
<% Response.Buffer = True %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>achem 1</title>
</head>

<body>
<%
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")

rs.Open "SELECT * FROM info WHERE ID=1;", "DSN=achem"

' rs.Open "SELECT tool_type,
' forward, backward FROM info WHERE ID=1;", "DSN=achem"

%>

<%
Const ForReading = 1
Const Create = False
' Filename = "descriptions\Dispenser Desc PQH2398.txt"

Dim objFSO, TS, strLine, strFileName

strFileName = Server.MapPath(rs("descriptions"))

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set TS = objFSO.OpenTextFile(strFileName, ForReading, Create)
%>

<table border='0' width="648" cellspacing='0' cellpadding='0'>
<tr>
<td width=50%><font face="Arial" size="2"><img border="0" src="<% =rs("pictures") %>"></font></td>
<td width=50%><font face="Arial" size="2">
<%
If Not TS.AtEndOfStream Then
Do While Not TS.AtendOfStream
strLine = TS.ReadLine
Response.Write strLine
Response.Write "<br>"
Loop
End If

TS.Close
Set TS = Nothing
Set objFSO = Nothing
%></font>
</td>
</tr>
</table>
<hr width="648" noshade size="1" align="left" color="#000000">
<table border='0' width="648" cellspacing='0' cellpadding='0'>
<tr>
<td width=50%>
<table border="0" width="300" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><font face="Arial" size="2">Tool Type:</font></td>
<td width="50%"><font size="2" face="Arial"><% =rs("tool_type")%></font></td>
</tr>
</table>
</td>
</tr>

</table>

<p><font size="2" face="Arial"><a href="<% =rs("forward") %>">next ></a></font></p>

</body>

<%
rs.Close
Set rs = Nothing
%>

What I'd like for this to do, is when the user clicks next on the page, it takes them to "ID 2" in the database but still uses this asp outline to display it. That way I don't have to have an asp file for each row. So I'm trying to get the ID to change automatically. I don't know if there is some template that will do this or maybe I need to use some code in VBScript to do this. If someone could give me some pointers on what I can do, I'd really appreciate it. Thank you

Reply With Quote
  #2  
Old January 28th, 2004, 11:39 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
I would post this question in the ASP forum. Most here just work in Access only

S-

Reply With Quote
  #3  
Old January 28th, 2004, 11:47 AM
ProEdge's Avatar
ProEdge ProEdge is offline
Contributing User
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2004
Location: Somewhere I belong
Posts: 1,557 ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level)ProEdge User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 34 m 55 sec
Reputation Power: 39
I thought this was the asp forum?

Reply With Quote
  #4  
Old January 28th, 2004, 04:56 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
You want the part of the forum that is ASP Coding

Most of the people in the part deal strickly with Access Coding (VBA)

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Displaying next record from database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway