View Full Version : Overide ADO.SQL properties


10-29-2004, 01:49 AM
After I have logged in (see my former topic on this message board), I want to display part of a table using a grid component. The source behind this component is an Access database. Is it possible to override the ADO.SQL property to filter the data, using a session variable set in the login validate event? If so, how does it work?

Selwyn Rabins
10-29-2004, 06:53 AM
yes it is.

if you edit the .a5w page that contains the component, and you switch to source view, you will see code like this in the "head" section:

(In this case my grid component is called "access")

Delete Tmpl
DIM Tmpl as P
tmpl = a5w_load_component("access")

with tmpl
componentName = "access"
ADO.SQL = "SELECT * FROM [Customers] WHERE City = '" + session.cityname + "'"
end with

you will notice that i have overwritten the ado.sql property.