|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 %> ************************************************** ****************** |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Need help for Error 800a0bcd |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|