Source language: Translate to:

DBF Pluging Query and not found

Questions about NeoBook PlugIns

Moderator: Neosoft Support

DBF Pluging Query and not found

Postby datadon » Fri Jul 21, 2006 5:27 pm

When I query a DBF file and the query does not find any records because the value being queried does not exist, how can I get the action to change at that point?

It gives me a message that no records were found, but I want to change the next action if the query is not found?

What is the best way to do that?
Thanks
Don

'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
User avatar
datadon
 
Posts: 389
Joined: Sun Apr 03, 2005 7:55 pm
Location: Lorena Texas

Postby Rasl » Sat Jul 22, 2006 7:20 am

From NeobookDb help:

dbfShowErrors "False"


dbfQuery "sample.dbf" "City=Pittsburgh AND LastName=Jones"
If "[dbfQueryResult]" ">" "0"
AlertBox "Hello" "I found [dbfQueryResult] records."
Else
AlertBox "Hello" "I didn't find any records."
EndIf

salu2
Rasl
 
Posts: 129
Joined: Sat Apr 02, 2005 8:25 am
Location: Buenos Aires, Argentina

Postby Wrangler » Sat Jul 22, 2006 7:22 am

dbfQuery "[pubdir]yourdb.dbf" "name<>0"

If "[dbfQueryResult]" ">" "0" ...If record found
...Actions here....
else
...Not found actions here...
EndIf

dbfShowAll "[pubdir]yourdb.dbf"
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby datadon » Sat Jul 22, 2006 7:30 am

Thanks guys. I was just looking in the dbf help file and I found the queryresults variable. I forgot that the database vars are not in the regular help file.

Yep that'll do the trick. I'm back in business.
Don

'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
User avatar
datadon
 
Posts: 389
Joined: Sun Apr 03, 2005 7:55 pm
Location: Lorena Texas


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 3 guests