>Hi evereyone!
>I have a form where I have three buttons so that I can access info from separate databases each time. The problem is how can I open each database for each click and close the ones not in use. Do i need to add all the tables from all databses to the data environment. Actually these databses have same tables, stucture-wise and name-wise, but databse names are different.
>PLEASE HELP!
Are you extracting information from the tables with Select statements, or are the tables/fields bound to specific controls on the form.
If select statements to get data, you can prefix the tables with the dbc to get the proper data.
if button1 clicked
lcDBC = "DBCName1"
else
lcDBC = "DBCName2"
endif
select a.fld1, a.fld2, a.fld3;
from ( lcDBC + "!AnyTable" ) a;
where a.fld1 = cond....
If the data is bound, you are looking at a more difficult solution that is workable but may not be as simple as you might desire.