Solved

EOF and BOF

Posted on 2004-10-04
4
901 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now