Wrox Programmer Forums
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 May 17th, 2007, 01:23 AM
Authorized User
Join Date: May 2007
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to MathLearner
Default Error msg 3021


    Dim rspara As New ADODB.Recordset
Me.Frame2.Enabled = True
Me.cb_exit.Enabled = True
Me.start.Enabled = True
Me.cb_Options.Enabled = True
Me.cb_print.Enabled = True
rspara.Open "select * from Parameter_Setting where set_code=5 and status=1", dbconn, adOpenKeyset, adLockReadOnly
If rspara!status = 0 Then
Me.Order_Card.Enabled = False
Me.Order_Card.Enabled = True
End If
Me.Flex.Enabled = True
Me.cb_Sel_Match.Enabled = True
Me.cb_cut_order.Enabled = True
Me.From_Date.Enabled = True
Me.To_Date.Enabled = True

When I run this function I face an error message "3021" with the following statement:

"Either BOF or EOF is true, or the current record has been deleted. Requested operation requires a current record."

I am not sure what I am doing wrong here.

Please help.

Thanks in advance ...

Old May 17th, 2007, 07:41 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi

hi there..

there is anything wrong with this, the only thing that is happening is that your query doesn't return a row ;)

try that query in a query analizer to see if that return something...

to avoid this problem test for both .eof and .bof before trying to read an actual value.



================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
================================================== =========
I know that CVS was evil, and now i got the proof:
================================================== =========

Similar Threads
Thread Thread Starter Forum Replies Last Post
error msg almotions ASP.NET 2.0 Basics 3 February 12th, 2008 08:34 AM
error msg aspsuraj BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 November 27th, 2006 08:30 PM
error msg not sure how to code this De-zypher Classic ASP Basics 1 May 24th, 2006 04:05 PM
runtime error 3021-no current record togs74 Access 1 July 30th, 2005 02:10 AM
Error 3021 - No Current Record JackNimble BOOK: Expert One-on-One Access Application Development 5 October 2nd, 2004 03:26 PM

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