Refreshing field information after database change
Posted: Fri  23 Sep 2016 10:53
				
				In our application we are switching database connections during runtime.
Each database uses the same view but with different columns.
If we change the database from the connection during runtime the TMSQuery keeps all the field information of the old database.
This is a problem because every view in each database has additional or different field informations.
How do we refresh all the field informations?
Thanks in advance
			Each database uses the same view but with different columns.
If we change the database from the connection during runtime the TMSQuery keeps all the field information of the old database.
This is a problem because every view in each database has additional or different field informations.
Code: Select all
connection.Database := 'Database1';
query.Connection := connection;
query.SQL.Text := 'SELECT * FROM View';
query.Open;
query.Close;
connection.Database := 'Database2';
query.Open; // <- Query has already fields of Database1 ViewThanks in advance