[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

vb5-rdo

Posted on 1998-09-08
5
Medium Priority
?
167 Views
Last Modified: 2010-04-30
Dear Experts,

Can you please  tell me how to detect there is no records in database by using RDO method ?
thanks


SWP
0
Comment
Question by:SWP
[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
5 Comments
 

Accepted Solution

by:
usermiles earned 50 total points
ID: 1433729
rstObject.movefirst
   If rstObject.EOF = True Then    
      MsgBox "No Records were found"
   End If

If you use the rst.EOF command in the above example, this will set the resultset to the first record , and the If statement tests to see if you are at the end of the file.
0
 
LVL 2

Expert Comment

by:Veroland
ID: 1433730
If you want to check a resultset it is easier if you use if RS.rowcount = 0.
usermiles example with give a error if there is no record in the table.
0
 

Expert Comment

by:manish77
ID: 1433731
I agree with veroland. The best way is to check the count property
0
 

Expert Comment

by:jharri
ID: 1433732
Depending on the datasource and the ODBC driver in use, rowcount can be expensive.  I suggest the following:

if rst.eof and rst.bof then
    Exit Sub
Else
    'Process the records
endif

No need here to use a move method (which is what could generate the error)

0
 

Author Comment

by:SWP
ID: 1433733
UserMiles:

   thanks for ur answer, but I prefered using the following:) since the I am using the SQL Server, there are no problems in using the rowCount method, but if I am using the Acces Driver, then
jharri's method is suggested.

 If rs.rowcount=0 then
    msgbox "no record found"
end if
 
but I heard jharri said that the rowcount is expensive, why do u think so ?



SWP
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

656 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