Code: Select all
qu := TMSQuery.Create(nil);
try
qu.Connection := TMSConnection.Create(qu);
qu.Connection.Server := '...';
qu.Connection.Username := '...';
qu.Connection.Password := '...';
qu.Connection.Database := 'DATABASE-2016';
qu.SQL.Text := 'SELECT * FROM [DATABASE-2016].DBO.[TABLE]';
qu.Open;
qu.RefreshRecord;
finally
qu.Free;
end;Currently I don't even have a viable workaround as i can't remove the default database and the sql-text is dynamically created.