Solved

EOF and BOF

Posted on 2004-10-04
4
909 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

710 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