Uncle Argyle Posted October 6, 2006 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.
daremo Posted October 6, 2006 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.
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