maxhugen
Posts: 272
|
| Posted: 04/20/2008, 9:24 PM |
|
In a Record 'employees1', I found that I can echo the DataSource of a listbox 'section_id' in the listbox's BeforeSelectExecute event using:
echo "SQL: " . $employees1->section_id->ds->SQL . "<br>";
echo "ORDER BY: " . $employees1->section_id->ds->Order . "<br>";
echo "WHERE: " . $employees1->section_id->ds->Where . "<br>";
But when I try to echo the DS for the Record itself, in the record's BeforeSelectExecute event , I don't get any output:
echo "SQL: " . $employees1->ds->SQL . "<br>";
echo "ORDER BY: " . $employees1->ds->Order . "<br>";
echo "WHERE: " . $employees1->ds->Where . "<br>";
Can anyone suggest why this doesn't echo any output?
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
DonP
|
| Posted: 04/21/2008, 12:34 AM |
|
You can't echo in a Before Build Select event as far as I know. For
testing purposes, add a Label somewhere in the grid or record with a
Before Show event. There is a built-in function for displaying the SQL
but unfortunately I cannot recall it at the moment. Maybe someone else
has that information.
Don (DonP)
maxhugen wrote:
> In a Record 'employees1', I found that I can echo the DataSource of a
> listbox 'section_id' in the listbox's BeforeSelectExecute event using:
> echo "SQL: " . $employees1->section_id->ds->SQL . "<br>";
> echo "ORDER BY: " . $employees1->section_id->ds->Order . "<br>";
> echo "WHERE: " . $employees1->section_id->ds->Where . "<br>";
> But when I try to echo the DS for the Record itself, in the record's
> BeforeSelectExecute event , I don't get any output:
> echo "SQL: " . $employees1->ds->SQL . "<br>";
> echo "ORDER BY: " . $employees1->ds->Order . "<br>";
> echo "WHERE: " . $employees1->ds->Where . "<br>";
> Can anyone suggest why this doesn't echo any output?
>
> _________________
> Max
> (99.9% CCS Newbie)
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
maxhugen
Posts: 272
|
| Posted: 04/21/2008, 3:01 AM |
|
Don, the echo works OK in the Listbox BeforeBuildSelect event, but not in the Record's BeforeBuildSelect event. I only tried it in the Record's event to see if something was returned. Strange...
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
wkempees
|
| Posted: 04/21/2008, 4:27 AM |
|
You build the SQL for the record through VQB?
What Type is it SQL or TABLE (= default)
Somehow I remember if type SQL BeforeBuildSelect is not executed.
Walter
|
|
|
 |
aondecker
Posts: 58
|
| Posted: 04/21/2008, 4:42 AM |
|
Quote maxhugen:
In a Record 'employees1', I found that I can echo the DataSource of a listbox 'section_id' in the listbox's BeforeSelectExecute event using:
echo "SQL: " . $employees1->section_id->ds->SQL . "<br>";
echo "ORDER BY: " . $employees1->section_id->ds->Order . "<br>";
echo "WHERE: " . $employees1->section_id->ds->Where . "<br>";
But when I try to echo the DS for the Record itself, in the record's BeforeSelectExecute event , I don't get any output:
echo "SQL: " . $employees1->ds->SQL . "<br>";
echo "ORDER BY: " . $employees1->ds->Order . "<br>";
echo "WHERE: " . $employees1->ds->Where . "<br>";
Can anyone suggest why this doesn't echo any output?
echo "SQL: " . $employees1->ds->SQL . "<br>";
echo "ORDER BY: " . $employees1->ds->Order . "<br>";
echo "WHERE: " . $employees1->ds->Where . "<br>";
exit();
if you put the exit() at the end it will stop everything else and output your echo statements to the screen.
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 04/21/2008, 4:50 AM |
|
In db_mysql.php (find other if using diff DB)
there is a line
$debug = 0;
change that to
$debug = 1;
and all you SQL will be displayed for debugging.
Although this might not be the best option, you will be able to see what is generated.
(That can be copied and pasted into a DB CLI tool to see if valid)
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
maxhugen
Posts: 272
|
| Posted: 04/21/2008, 6:04 AM |
|
@walter
The Type is Table.
@aondecker
Tried the exit(), I found it still didn't output the echo statements.
@walter
Using that debug switch a lot now - think it was you that pointed it out to me originally. Its a problem with AJAX though - with it ON, AJAX calls fail!
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
|