Q: Views and dynamically changing DWs

Q: Views and dynamically changing DWs

Post by David Grog » Fri, 12 Jan 1996 04:00:00



Hi Folks,

        I'm developing an application within which we have created views
of the data to facilitate data security. Each of group of users have a
different view of the data.

        Ive created a whole bunch of data windows which are to have their
SQL Select dynamically changed at run time so that the correct view for
the particular user is the correct data source.

        I do this by replacing the table name in the select statment:

old_select = dw.Describe("Datawindow.Table.Select")
new_string = replace_text(old_select,gen_table,view_table)
rtn = dw_details.("DataWindow.Table.Select='" + new_string + "'")

        The Select statement is set with no errors. However when I try
and retrieve data I get the following error message:

        Select Error: SQLSTATE = S0002
        [WATCOM][ODBC DRIVER] Table or View not found: table 'views' not found

        When I'm in the database painter the view is accessed without
errors. Any ideas on what I'm doing wrong ?

        Also, does anyone have a better solution for dealing with views ?

        thanks for any advice .

        David Grogan