Page 1 of 1

Don't show on DataGrid (Suggestion)

PostPosted: Fri Apr 18, 2014 10:43 am
by AsleyCruz
Hi guys!
Something simple, I say :D

I used "dbpShowAll" to show all records on the DataGrid
but if I use the "dbpFind" command or this "dbpExecSQL"
to perform a new search, I would'n like the DataGrid
display the information of these searches.

• How I can prevent that this information can be displayed
on Datagrid?

• This would be a suggection?
Like this "dbpShowAll", "dbpFind", "dbpExecSQL" properties:
ShowResultsOnDataGrid=False or True


Image

With this suggestions, we can choose when the DataGrid can be affectec
by these SQL Commans.

Hope you can help me ;) regards!

Re: Don't show on DataGrid (Suggestion)

PostPosted: Fri Apr 18, 2014 12:52 pm
by Gaev
AsleyCruz:

When you use dbpExecSQL, you can specify a "results table" ...
Code: Select all
dbpExecSQL "database id" "SQL" "results table"

From the Help file ...
results table (optional)

This parameter can be used to enter the name of the table where you want the results of the query to be displayed. This may be the name of an existing database table or it can be a temporary table. If the table specified does not exist in the database, it is assumed to be a temporary table. Leave this parameter blank to auto detect the table name or if the query does not return any results.

A temporary table exists only while your publication is running and is not physically part of the database. However, most temporary tables derive their contents from real data, so any edits you make may affect other tables. A temporary table created with dpbExecSQL can be opened with the dbpOpenTable and displayed with dbpShowGrid actions. Actions that require a physical table, such as dbpAddField or dbpQuery, cannot be used with a temporary table.

So if you direct your query to a temporary table, the Rectangle will continue to display the Grid with the results of dbpShowGrid and dbpShowAll.

Re: Don't show on DataGrid (Suggestion)

PostPosted: Sat Apr 19, 2014 11:36 am
by AsleyCruz
Gaev wrote:So if you direct your query to a temporary table, the Rectangle will continue to display the Grid with the results of dbpShowGrid and dbpShowAll.


Hi Gaev!
Many thanks, it works perfectly! :wink:

One thing more... how can I add items to ComboBox or ListBox using
dbpExecSQL or dbpFind but without "Loop" action? Is there anyway?
Hope yes! ;)

Best regards to all! :D

Re: Don't show on DataGrid (Suggestion)

PostPosted: Sat Apr 19, 2014 2:22 pm
by ebear
Hello Ernesto,

Yes you can ;-)

After dbpExecSQL

Code: Select all
dbpFieldToVar "DB" "TABLE" "FIELDNAME" "[ComboBox_Variable]" "Delimiter=[#13];SkipBlanks=No;NoDuplicates=No;DelimiterInContext=Leave"

Place the [ComboBox_Variable] in the "List Items" box, the parameters "SkipBlanks=No;NoDuplicates=No;DelimiterInContext=Leave" can be change by needs, "Delimiter=" needs to be "[#13]".
Same works also for a ListBox.

Regards,

Eric

Re: Don't show on DataGrid (Suggestion)

PostPosted: Sat Apr 19, 2014 3:32 pm
by AsleyCruz
ebear wrote:Hello Ernesto, Same works also for a ListBox.

Regards,

Eric


Hi Eric... many thanks :wink: ... it works perfectly too :D

Best regards... see you next questions 8)

Re: Don't show on DataGrid (Suggestion)

PostPosted: Sun Apr 20, 2014 7:41 am
by ebear
No problem Ernesto, happy to give something back to the community.....

Happy Easter everyone....

Eric