Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming 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 September 22nd, 2004, 09:15 PM
patelbhavesh patelbhavesh is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 patelbhavesh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Need help for Error 800a0bcd

Can any one help me with the following code. It is giving me the following error
******************



ADODB.Fielderror '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /draic/Bhavesh/project2/total2.asp, line 80
************************************
Following is my code.
I would realy appresiate if you reply as soon as possible
*****************************************
<html>
<head>
<title>CET 381 Project</title>
</head>
<body bgcolor="cyan">
<%
'Declaring Variables
Dim cn
Dim rs
Dim cable_id
Dim cable_name
Dim cablecost
Dim cable_markup_cost
Dim cable_length
Dim quantity
Dim rightconnector
Dim leftconnector
Dim cableprice
Dim Cable
Dim cable_length_cost
Dim cLeft
Dim cRight
Dim left_connector_time
Dim right_connector_time
Dim left_connector_price
Dim right_connector_price
Dim termination
Dim assembly_Price
Dim qty_discount
Dim total
Dim result
'Retrieving Info From Previous Form
cable_name= Request("cablename")
quantity = Request("qty")
cable_length = Request("cablelength")
cable_id = Request("cableid")
rightconnector = Request("connector_B")
leftconnector = Request("connector_A")
'Determining Cable's Price based on Cable's Length
If ((cable_length >= 1) And (cable_length <= 100)) Then
cable_markup_cost = "SPrice"
Else
cable_markup_cost = "LPrice"
End If
'Determing Discount based on Quantity
If (quantity <= 5 ) Then
qty_discount = 1
ElseIf ((quantity >= 6) And (quantity <= 20)) Then
qty_discount = 0.05

ElseIf ((quantity >= 21) And (quantity <= 50)) Then
qty_discount = 0.1
ElseIf ((quantity >= 51) And (quantity <= 100)) Then
qty_discount = 0.2
ElseIf ((quantity >= 101) And (quantity <= 250)) Then
qty_discount = 0.3
Else
qty_discount = 0.3
End If
'SQL Command
strSQLCable = "SELECT " & cable_markup_cost & ", cost FROM tbcables WHERE cable ='" & cable_name & "'"
rightconnector = "SELECT price, time FROM tbassembly WHERE connector_id=(SELECT connector_id FROM tbconnectors WHERE connector='" & rightconnector & "') AND cable_id=(SELECT cable_id FROM tbcables WHERE cable='" & cable_name & "');"
leftconnector = "SELECT price, time FROM tbassembly WHERE connector_id=(SELECT connector_id FROM tbconnectors WHERE connector='" & leftconnector & "') AND cable_id=(SELECT cable_id FROM tbcables WHERE cable='" & cable_name & "');"
termination = "SELECT HourRate, WorkFactor, MaterialCost, Markup FROM termination"
'Configuring Connection to Database
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
cn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\draic\Bhavesh\project2\storeDB.mdb"))
rs.ActiveConnection = cn
'Getting Right Connector Price and Time
rs.Open rightconnector
right_connector_price = (rs.Fields(0))'<--HERE IS THE ERROR
right_connector_time = (rs.Fields(1))
rs.Close


'Getting Left Connector Price and Time
rs.Open leftconnector
left_connector_price = (rs.Fields(0))
left_connector_time = (rs.Fields(1))
rs.Close

'Getting Cable Info
rs.Open Cable
cablecost = (rs.Fields(1))
cable_markup_cost = (rs.Fields(0))
cable_length_cost = ( cablecost + cable_markup_cost) * cable_length
rs.Close
'Getting Termination Cost for Connectors
rs.Open termination
cleft = ( left_connector_time / 60 ) * rs(0) * rs(1) * rs(2)
cright = ( right_connector_time / 60 ) * rs(0) * rs(1) * rs(2)
'Calculating Total
assembly_price = ( left_connector_price + cleft + right_connector_price + cright ) * rs(3) + cable_length_cost
result = ( assembly_price * quantity ) * qty_discount
'Formating Output
total = FormatCurrency(Result, 2)
%>
<center>
<p>Order Date: <%response.write(date())%>
<p>Cable Type: <% response.Write (cable_name) %>
<p>Cable Length: <% response.Write (cable_length) %> feet
<p>Left Connector Type: <% response.Write (leftconnector) %>
<p>Right Connector Type: <% response.Write (rightconnector) %>
<p>Order Quantity: <% response.Write (Round(quantity)) %>
<p>Part Number: <% response.write (quantity & "-" & leftconnector & "-" & cable_length & cable_name & "-" & rightconnector) %></b></td>
<p>Order Total: <% response.Write (total) %>
<p><input type="button" value="PRINT" onclick="javascript:window.print()">
<a href="index.html" target="_top">RESET</a>
</td>
</center>
</body>
</html>
<%
'Closing Connections
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
%>
************************************************** ******************

Reply With Quote
  #2  
Old September 23rd, 2004, 09:50 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 27 m 42 sec
Reputation Power: 470
You have to check the returned recordset to make sure there is data being returned.

Example:
Code:
If rs.eof Then
   No records were returned
Else
   Records were returned, display them
End If

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Need help for Error 800a0bcd


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 5 hosted by Hostway
Stay green...Green IT