Print Page | Close Window

Check if a data exist.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25907
Printed Date: 28 March 2026 at 4:07am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Check if a data exist.
Posted By: Nerz
Subject: Check if a data exist.
Date Posted: 28 June 2008 at 4:05pm
What's the best way to check to see certain data exists in a database. and from the tutorial i see a do while loop, how is the format of a if statement.



Replies:
Posted By: MadDog
Date Posted: 01 July 2008 at 8:46pm
A simple "EOF" (end of file) check works just fine.

strSQL = "SELECT tblTableName.Record_ID FROM tblTableName WHERE Record_ID = 1;"

rsReset.Open strSQL, adoCon

If rsRecordset.EOF Then
    'record does not exist
Else
    'record exists
End If

rsRecordset.Close



-------------
http://www.iportalx.net" rel="nofollow">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net