Source language: Translate to:

Empty results

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Empty results

Postby smartmedia » Sun Apr 27, 2008 12:11 am

Hi...

I have a table contains 2 fields, 1) is blob for picture and 2) a text field. The results reflects on a grid.


Code: Select all
dbpExecSQL "Rapid" "SELECT id,Title,Linktype from Data where (DateInserted >= TIMESTAMP(CURRENT_DATE) OR DateUpdated >= TIMESTAMP(CURRENT_DATE)) AND Status = 1 ORDER BY Title;" "Data1"

Now when i run this above query and the result is none, 1 record shows up with the default pic for blob and empty text, and also i receive error.


Is this a bug or what...???
Can you fix it not to show the picture...

Thanks
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Mon Apr 28, 2008 10:53 am

That's normal behavior for a database grid. After the query, you can examine the table's $RecCount variable to find the number of found records. If it's zero, then display a message or whatever you want to happen. For example:

dbpExecSQL...
If "[Rapid.Data.$RecCount]" "=" "0"
AlertBox "Sorry" "No records found."
dbpShowAll "Rapid" "Data"
EndIf
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Tue Apr 29, 2008 12:02 am

Hi...

Dave,
I think you didn't understand me.
That query
Code: Select all
dbpExecSQL "Rapid" "SELECT id,Title,Linktype from Data where (DateInserted >= TIMESTAMP(CURRENT_DATE) OR DateUpdated >= TIMESTAMP(CURRENT_DATE)) AND Status = 1 ORDER BY Title;" "Data1"

return me an empty record in grid with the default pic in blob field Linktype.
So the $RecCount now is 1 which is wrong, it suppose to return 0.
That came up from the moment i add the blob field into the database.
My dabase is MySQL 4.1
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Tue Apr 29, 2008 9:58 am

Unfortunately, I don't have any control over what records the database server returns in response to a query. DBPro doesn't perform the query, it just passes the code you enter along to the DB server.

When I try something similar here with MS Access, and no records are found, $RecCount is zero. The grid shows an empty line, but that's how the database-aware grids are designed to work. Nevertheless, $RecCount should contain the actual number of found records.

If you want to send me a sample pub that demonstrates the problem using mySQL, I can look at it.
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