Source language: Translate to:

dbpquery

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

dbpquery

Postby ajhunt » Fri Feb 29, 2008 8:48 am

Hi All,

Wonder if anyone else has noticed that when doing a dbpquery to find any records in a db a little quirk which was not in the old version.

If records are found it displays only the records found (as expected)

BUT is no records are found that meet the query it displays no records at all - not leaving the current records which were on show in the rectangle.

Am I doing something wrong and missed a setting somewhere I wonder.

Any help really appreciated - Thanks

Regards
Anthony
ajhunt
 
Posts: 223
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom

Postby Wrangler » Fri Feb 29, 2008 8:58 am

It does that for me too. What I do is follow the query with an if statement.

If [ID.table.$reccount] = 0

then show the grid.
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: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby ajhunt » Fri Feb 29, 2008 9:10 am

Hi Wrangler, thanks for a speedy reply and help. You mean like what I have now done below - but still just shows an empty db when finding no records.

.---------------------
If "[GenderFilter]" ">" ""
If "[Filter]" ">" ""
SetVar "[Filter]" "[Filter] AND "
EndIf
SetVar "[Filter]" "[Filter]Gender = [#34][GenderFilter][#34]"
EndIf
.---------------------

.---------------------
.Do the Query
.---------------------
If "[Filter]" ">" ""
dbpQuery "MSA_HistoryDatabase" "History" "[Filter]"
If "[MSA_HistoryDatabase.History.$RecCount]" "=" "0"
dbpShowGrid "MSA_HistoryDatabase" "History" "Rectangle5"
Endif
.Results
If "[MSA_HistoryDatabase.History.$RecCount]" ">" "0"
AlertBox "Information" "[MSA_HistoryDatabase.History.$RecCount] record(s) Found."
Else
AlertBox "Information" "No record(s) found."
EndIf
Else
AlertBox "Information" "No Filter(s) selected."
EndIf

.-----------------------

Any recogmendations Wrangler?

Regards
Anthony
ajhunt
 
Posts: 223
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom

Postby Gaev » Fri Feb 29, 2008 9:25 am

Anthony:
BUT is no records are found that meet the query it displays no records at all - not leaving the current records which were on show in the rectangle.
Would this not be the logical response ? ... if you ask for a new query ... and there are no matching records ... then show no records ... not the result of some previous query.

a little quirk which was not in the old version.
I did not participate heavily in the pre-production releases ... so I can't confirm ... but I have always found the response to dbpQuery to be consistent.

Perhaps you are thinking of the other (NeoBookDB) plugin ... where dbfQuery would display ALL records in the database when there were no matching records ... illogical but the best Dave could do with the constraints of the plugin library.
User avatar
Gaev
 
Posts: 3735
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Wrangler » Fri Feb 29, 2008 9:29 am

It does that for me too. What I do is follow the query with an if statement.

If [ID.table.$reccount] = 0

then show the grid.


My error. I also include a dbpshowall if no records are found.
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: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby ajhunt » Fri Feb 29, 2008 10:36 am

Hi All,

Thanks for the info - I used to use the older version and it stayed showing the last filter if no records found - hey does not matter too much and will just have to keep it as it is and show all records again or just do the last query again.

Cheers for your help guys

Regards
Anthony
ajhunt
 
Posts: 223
Joined: Sat Apr 23, 2005 2:33 pm
Location: United Kingdom

Postby Neosoft Support » Mon Mar 03, 2008 12:35 pm

I think the correct response when the query results in no records being found is to display an empty table. That's the way most database applications handle queries.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests

cron