Solved

EOF and BOF

Posted on 2004-10-04
4
905 Views
Last Modified: 2013-11-13
i developed a program using VB6, that deals with an access database, using mdac 2.6, now everything is ok, but when i run it on windows 89, mdac 2.6 as well i have this problem

using a select statment, when i get one output record from a table full of records, i get BOF .
while on Windows 2000 i always get (not EOF)

and in all my code am using
if not lrs.EOF then
   ......
end if

Should i change all my code to use
if (not lrs.EOF) or (not lrs.BOF) then
....
end if

or is there a different solution
Note: Windows 89 is running as a virtual machine
0
Comment
Question by:standardxx
  • 2
4 Comments
 
LVL 3

Expert Comment

by:sgayatri
ID: 12215621
What exactly is the error you get and where?

print the value for lsr.eof and check.
Actually
if not lrs.EOF then
   ......
end if

is ok.
0
 
LVL 4

Accepted Solution

by:
VIkasumit earned 40 total points
ID: 12216011
Hi..

Yur problem is nto much clear in it self. Please Clearify it Or try this with assumption that you are checking the Rescordset if it contain Data Simple do something with it...

In VB if the recordset is empty it has both BOF and EOF set to  TRUE and hence the option here to check is

if not (lrs.BOF and lrs.EOF) then
....
end if

In this if it contain data it will do your code. other wise your pointer is some where on some data and you need to reposition it according to your need with lrs.MoveLast or MoveFirst.

Hope this will help otherwise send some more clearification on topic what you want to do

VIkasumit
www.sumitonnet.20m.com
0
 

Author Comment

by:standardxx
ID: 12224115
well when i changed curser type to adOpenForwardOnly and when getting one output record, i got the following: BOF = False , EOF = False

other wise i get BOF = true, EOF = False

Thats is when running the application on windows 98 , i know operating system has nothing to do, but i dont know whats wring with mdac in there

when running on windows 2000 , i always get EOF = False and BOF = False

thanks any way
0
 
LVL 4

Expert Comment

by:VIkasumit
ID: 12224168
Hi..

It is something to do with os as it seems though i am not sure but has not much of worry as I prefer to set the pointer of the data to my wish when ever i create or Fill data in recordset using the movefirst and movelast so it work my way and not os way.

Thank for Answer acceptance though.

VIkasumit
www.sumitonnet.20m.com
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question