Uncle Argyle Posted October 6, 2006 Share Posted October 6, 2006 Hi all, I have a program that uses the MySQL UDF (thanks cdkid!). If I query the database I want to know how to handle a return that is an empty set. for example, I have a query where I search the table 'apps' for a row that contains 20 in the column 'appno' $var = _query($db, "SELECT * FROM apps WHERE appno = 20) If no results are found, how do I handle this? I have tried something like this, but it generates an error. If $var.Fields("appno").value = "" Then MsgBox(0,"Test","no results found!") Else Msgbox(0,"Congrats", "Result = " & $var.Fields("appno").value) EndIf Thanks for any help, Mike. Link to comment Share on other sites More sharing options...
daremo Posted October 6, 2006 Share Posted October 6, 2006 I did this and it worked for me:With $var If .EOF Then (your code) EndifEndWithHi all,I have a program that uses the MySQL UDF (thanks cdkid!). If I query the database I want to know how to handle a return that is an empty set.for example, I have a query where I search the table 'apps' for a row that contains 20 in the column 'appno'$var = _query($db, "SELECT * FROM apps WHERE appno = 20) If no results are found, how do I handle this?I have tried something like this, but it generates an error.If $var.Fields("appno").value = "" Then MsgBox(0,"Test","no results found!")Else Msgbox(0,"Congrats", "Result = " & $var.Fields("appno").value)EndIfThanks for any help,Mike. Link to comment Share on other sites More sharing options...
Uncle Argyle Posted October 6, 2006 Author Share Posted October 6, 2006 Thanks so much! That did it!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now