Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL IF STATEMENT HELP PLEASE

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a SQL statement, where it looks for a matching record on a given user value.

How can i implement a If statement, if no matching records where found, to notify user that there is no records.

my code.

reSet.Open(dbOpenDynaset,SQL);
//Tried
if (reSet.IsEOF())
and
if (reSet == NULL)
{
AfxMessageBox(No record Found);
}

Did not work, can someone pls help me.
thanks in advance.
 
before you do anything check

if(!reSet.GetCount())
{
// no records
}
else
{

// you have records

}

Matt
 
Thanks Mat,

It works fine..

You ment if(!reSet.GetRecordCount())

Thanks Again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top