Solved

EOF and BOF

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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…
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…
Suggested Courses
Course of the Month6 days, 13 hours left to enroll

623 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