PC Review


Reply
Thread Tools Rate Thread

checking if recordset comes up empty ADODB/VB6

 
 
=?Utf-8?B?cGI=?=
Guest
Posts: n/a
 
      8th Jul 2005
i want to run a procedure if a recordset comes up empty....what is the
correct syntax?

Do While Not rstRecordSet.EOF
If rstRecordSet("ID") = Empty Then
MsgBox stempGlobal, vbCritical, "record not found"
'run procedure
Else
MsgBox rstRecordSet("PT_ID"), vbCritical, "record Found"
End If
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      8th Jul 2005
PB,

FYI this is either a VB6 nor an ADODB newsgroup. Probably do you have a
better change in newsgroups special for those.

Cor


 
Reply With Quote
 
=?Utf-8?B?S2VycnkgTW9vcm1hbg==?=
Guest
Posts: n/a
 
      8th Jul 2005
pb,

If rstRecordSet.BOF AND rstRecordSet.EOF Then
MsgBox "Record not found"
Else
'Process the records
End If

Note that you might want to use the newsgroups for VB6 and/or ADODB.

Kerry Moorman


"pb" wrote:

> i want to run a procedure if a recordset comes up empty....what is the
> correct syntax?
>
> Do While Not rstRecordSet.EOF
> If rstRecordSet("ID") = Empty Then
> MsgBox stempGlobal, vbCritical, "record not found"
> 'run procedure
> Else
> MsgBox rstRecordSet("PT_ID"), vbCritical, "record Found"
> End If

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking .bof and .eof for empty recordset? Matt Williamson Microsoft Access VBA Modules 4 20th Dec 2007 09:46 PM
Access 2002: bind adodb recordset to listbox recordset property Craig Buchanan Microsoft Access Form Coding 2 1st May 2005 12:14 AM
Checking for an empty recordset Tony Wainwright Microsoft Access Form Coding 1 11th Feb 2005 10:43 AM
Equivalent ADODB.Connector and ADODB.Recordset in VB.NET Marty Microsoft Dot NET 3 25th Sep 2004 10:36 PM
Equivalent ADODB.Connector and ADODB.Recordset in VB.NET Marty Microsoft VB .NET 3 25th Sep 2004 10:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:50 AM.