Dynamically assign a table to grid or form?

Pls can anyone help me I want to assign “any table” within the connected databse to a grid for report generation. And form of course.

Thanks.
Wollnet

Re: Dynamically assign a table to grid or form?

There is no macro that I see.

Try using this in onInit:

$this->Ini->nm_tabela = ‘mytable’;

Regards,
Scott.

Re: Dynamically assign a table to grid or form?

Scott,
How do you find these variable names…! used for specific changes…!?
I want to try for the Filename and path returned by Document(Filename)…!

Advise

regards
Dhana

Re: Dynamically assign a table to grid or form?

I load the generate code and have a look around and see what SC is doing. There is no list that I am aware of.

Regards,
Scott.

Re: Dynamically assign a table to grid or form?

Thanks scott,
i could able to read and find something…!

Reards
Dhana

Re: Dynamically assign a table to grid or form?

Scott,
This is not applicable to Quries…?

I am trying to change my SQL in a grid application…!
in Oninit

$mytable = “SELECT
Empcode,
Dm_Date,
Intime,
Outtime,
P_Status,
A_Status,
Shift_code,
Reason,
PAA_F,
EDR,
In_Status,
Entry_Type,
Slno,
FROM
dbo.DailyMasterDetails
Where Empcode=’[v_empcode]’ and A_Status=’[v_astatus]’ and Dm_Date >= ‘[v_fromdate]’ and Dm_Date <= ‘[v_todate]’”;

$this->Ini->nm_tabela = $mytable;

I am getting the following error…

Error while accessing the database:
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword ‘FROM’.
select count(*) from SELECT Empcode, Dm_Date, Intime, Outtime, P_Status, A_Status, Shift_code, Reason, PAA_F, EDR, In_Status, Entry_Type, Slno, FROM dbo.DailyMasterDetails Where Empcode=‘0031’ and A_Status=‘AA’ and Dm_Date >= ‘11/26/2008’ and Dm_Date <= ‘12/25/2008’

Please advise

Thanks in advance
Regards
Dhana

Re: Dynamically assign a table to grid or form?

Open your grid, open the menu SQL and look for “Variable for Table”.

There you can nominate a variable, ex: [var_my_table] dbo.DailyMasterDetails and dynamically change the variable [var_my_table].

Re: Dynamically assign a table to grid or form?

diogo,
Thanks… let me try and get back if any issues

Regards
Dhana