ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

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 Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 30th, 2003, 05:38 PM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP Database table

I want to make an asp table for my database. I have two tables, one with peoples details and the other with their orders. I have done a one to many relationship between these.

What i would like to be able to do is a heading with the customer details, and under that all of what that person has ordered. Then another heading with a different customer and so on..

I'm really stuck, please help!

Dave

Reply With Quote
  #2  
Old June 30th, 2003, 06:27 PM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here is the code so far..

<html>
<body bgcolor="#FFFFCC" text="#006600" style="text-align: left">
<%
dim IP
IP=Request.ServerVariables("REMOTE_ADDR")
if IP <> "62.3.248.126" then
Response.Redirect("access.htm")
end if

dim myConnection
dim LoginInfoRst
dim sqlString
dim connectString

set myConnection = Server.CreateObject("ADODB.Connection")
set myConnection2 = Server.CreateObject("ADODB.Connection")
set LoginInfoRst = Server.CreateObject("ADODB.Recordset")

myConnection.Open "Data Source=" & Server.Mappath("npmc.mdb") & ";Provider=Microsoft.Jet.OLEDB.4.0;"

sqlstring = "SELECT tblUsrDetails.*, tblPrescription.*"
sqlstring = sqlstring & "FROM tblUsrDetails INNER JOIN tblPrescription ON tblUsrDetails.PatientID = tblPrescription.PatientID "
sqlstring = sqlstring & "WHERE tblPrescription.PatientID = tblUsrDetails.PatientID "

Set LoginInfoRst = myConnection.Execute(sqlString)

if (LoginInfoRst.BOF) AND (LoginInfoRst.EOF) then

%>
<center>
<p>&nbsp; </p>
<p>&nbsp; </p>
<font size="5" face="Arial, Helvetica, sans-serif" color="#006600"><b>No records
found</b> </font>
</center>
<%

else

%>
<form method="POST" action="aspdelete.asp">
<% do until LoginInfoRst.eof %>

<table border="0" width="74%" cellspacing="0" cellpadding="0" id="table1">
<tr>
<td>
<table align=center COLSPAN=8 CELLPADDING=5 BORDER=0 WIDTH=457 height="57" id="table2">

<TR>
<td valign=TOP bgcolor="#800000" width="85" align="center">
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Forename</font></div>
</td>
<TD VALIGN=TOP BGCOLOR="#800000" width="96" align="center">
<div align="center">
<font style="ARIAL NARROW" color="#ffffff" size="3" face="Arial, Helvetica, sans-serif">
Surname </font> </div>
</td>
<TD VALIGN=TOP BGCOLOR="#800000" width="100" align="center">
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Date of Birth</font></div>
</td>
<TD VALIGN=TOP BGCOLOR="#800000" width="126" align="center">
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Contact Number</font></div>
</td>

</tr>
<tr>
<td bgcolor="f7efde" align=center width="85" height="21"> <font style="arial narrow" size=2>
<%=LoginInfoRst("Forname")%> </font> </td>
<td bgcolor="f7efde" align=center width="96" height="21"> <font style="arial narrow" size=2>
<%=LoginInfoRst("Surname")%> </font> </td>
<td bgcolor="f7efde" align=center width="100" height="21"> <font style="arial narrow" size=2>
<%=LoginInfoRst("DOB")%> </font> </td>
<td bgcolor="f7efde" align=center width="126" height="21"> <font style="arial narrow" size=2>
<%=LoginInfoRst("ContactNumber")%> </font> </td>
<% session("ASD") = LoginInfoRst("tblUsrDetails.PatientID")%>
</tr>
</table>
</td>
</tr>
</table>

<table align=center COLSPAN=8 CELLPADDING=5 BORDER=0 WIDTH=606 height="64">
<TR>
<td valign=TOP bgcolor="#800000" width="142">
<div align="center">
<font size="3" face="Arial, Helvetica, sans-serif" color="#FFFFFF">
Description </font></div>
</td>
<TD VALIGN=TOP BGCOLOR="#800000" width="58">
<div align="center">
<font style="ARIAL NARROW" color="#ffffff" size="3" face="Arial, Helvetica, sans-serif">
Strength </font> </div>
</td>
<TD VALIGN=TOP BGCOLOR="#800000" width="56">
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Quantity</font></div>
</td>
<TD VALIGN=TOP BGCOLOR="#800000" width="109">
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Other Items</font></div>
</td>
<td valign=TOP bgcolor="#800000" width="118">
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Chemist</font></div>
</td>
<td valign=TOP bgcolor="#800000" width="49">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Deliver</font></td>
<td valign=TOP bgcolor="#800000" width="49">
<font face="Arial, Helvetica, sans-serif" color="#FFFFFF">Delete?</font></td>

</tr>
<% do until (LoginINfoRst("tblUsrDetails.PatientID") <> Session("ASD")) %>
<tr>
<td bgcolor="f7efde" align=center width="142" height="30"> <font style="arial narrow" size=2>
<%=LoginInfoRst("Description")%> </font> </td>
<td bgcolor="f7efde" align=center width="58" height="30"> <font style="arial narrow" size=2>
<%=LoginInfoRst("Strength")%> </font> </td>
<td bgcolor="f7efde" align=center width="56" height="30"> <font style="arial narrow" size=2>
<%=LoginInfoRst("Quantity")%> </font> </td>
<td bgcolor="f7efde" align=center width="109" height="30"> <font style="arial narrow" size=2>
<%=LoginInfoRst("Other")%> </font> </td>
<td bgcolor="f7efde" align=center width="118" height="30"> <font style="arial narrow" size=2><%=LoginInfoRst("Chemist")%>
</font> </td>
<td bgcolor="f7efde" align=center width="49" height="30"> <font style="arial narrow" size=2><%=LoginInfoRst("Deliver")%>
</font> </td>
<td bgcolor="f7efde" align=center width="49" height="30"> <font style="arial narrow" size=2><input type="checkbox" name="checkboxName"_
value='<%=LoginInfoRst("Prescription ID")%>'>
</font> </td>
</tr>
<% LoginInfoRst.MoveNext %>
<% loop %>
</table>
<% loop %>
<p align="center">&nbsp;</p>
<p align="center"><input type="submit" value="Delete" name="B1"></p>
</form>
</body>
<%
end if
%>

Reply With Quote
  #3  
Old June 30th, 2003, 06:28 PM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I get this error when running the code above, when there is only one order for a particualr customer.

error '80020009'
Exception occurred.

/database/respresc.asp, line 115

Reply With Quote
  #4  
Old July 1st, 2003, 04:18 AM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How would you recommend fixing..?

Can i tell if there is only one record, and if there is it won't do a movenext?

It needs to move next if there is more than one record.

Reply With Quote
  #5  
Old July 2nd, 2003, 04:12 PM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Basically if you look at this site you will see what i'm trying to do.

http://www.npmc.nhs.uk/database/respresc.asp

Reply With Quote
  #6  
Old July 2nd, 2003, 04:19 PM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Getting there, got rid of the error now trying to sort out the layout.

Reply With Quote
  #7  
Old July 2nd, 2003, 05:14 PM
big_dave21 big_dave21 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 big_dave21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Done it, yipee. Thanks echolalia

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > ASP Database table


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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