Solved

EOF and BOF

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 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

15 Experts available now in Live!

Get 1:1 Help Now