Source language: Translate to:

dbpQuery question

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

dbpQuery question

Postby David de Argentina » Mon Jan 02, 2012 7:43 am

Hi Dave,

I'm using dbpQuery action on a MySQL remote enviroment.

Previous this, I dbpOpenTable the selected tables.

The help file says that this is equivalent to "Select * from table", this means i have the whole recordset on the client machine.

I can see when the action is executed, plugin forces to re read from server the new recordset. This behavior spends a lot of time.

Are there any way to get a subset of records, based on the recordset existent on the client machine ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Neosoft Support » Mon Jan 02, 2012 11:51 am

You can use dbpExecSQL to open the table instead of dbpOpenTable. This will allow you to limit the number of records returned. For example, the following will display just the first 50 records from the Contacts table:

dbpExecSQL "AddrBook" "SELECT TOP 50 * FROM Contacts" ""
dbpShowGrid "AddrBook" "Contacts" "Rectangle1"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby David de Argentina » Mon Jan 02, 2012 1:24 pm

WOW !

We can show a grid without open a table ! Beautiful !

On the other hand, i made a dialog to search people.
Each time user press a key on the Inputbox Search Object, the function performs a search some like this

( Inputbox Object -> actions-> text changed : Variable name: [Search_FN] )

dbpQuery "db" "FullName" "FullName Like '%[Search_FN]%'"

Here is the problem.

dbpQuery asks the server for the query, the server performs the query and resend a new recordset.

With a MySQL server hosted on a webserver, each time user press a key, program spends near 5~6 seconds to reload the new recordset. it's an eternity... specially when i have the whole table on the RAM of the Client machine !

I know that:

* dbpExecSQL & dbpQuery works with the database on the server

* dbpFind works with the recordset of the local machine, but only take first coincidence.

Are there any trick to transform "dbpQuery" in "dbpLocalRecordsetQuery" ?

Thanks again
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Neosoft Support » Tue Jan 03, 2012 11:47 am

I'm not sure this will work with MySQL, but you could try adding the following to your connection string:

CursorLocation=Client
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
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 1 guest