title: Transition from legacy database to new one that works with legacy application
body: <p>I have a problem concerning legacy application that can’t be changed in any way (single executable file with no dlls) which is connected to a database that can be changed. It is a visual basic 6 application connecting to the database using ADO.Net. Database engine is a SQL Server 2008. The goal is to create new correct database that will work with legacy application</p>
  
  <p>It is coupled so tightly, that it does not even work with views instead of tables as suggested <a href="https://stackoverflow.com/a/1036607/3228432">here</a>. So the present situation look like this: <a href="https://i.stack.imgur.com/eYrwl.png" rel="nofollow noreferrer">current situation diagram</a></p>
  
  <p>Currently I am trying to research into the problem and find my options. I have some idea that might work:</p>
  
  <p><em>Since the approach to change tables to views does not work, I think that one possibility is to intercept the communication between app and legacy DB, read a sent command and redirect it somewhere else and not letting legacy db respond to the request.</em> </p>
  
  <p><em>Each command is either CRUD or procedure execution and we know what possible commands can be sent. Let’s suppose that a new database is set and has views corresponding to the legacy one. Commands are redirected to my own application that filters out everything and manipulates it (somehow) to work with the new schema.</em></p>
  
  <p><a href="https://i.stack.imgur.com/2mVA8.png" rel="nofollow noreferrer">Diagram of intercepted communication</a></p>
  
  <p>This is my general idea of what I want to do to avoid rewriting the legacy application which is tightly coupled. Someone already asked a question similar to mine. </p>
  
  <p>They discuss approach how to either dig commands from <a href="https://reverseengineering.stackexchange.com/questions/1617/server-side-query-interception-with-ms-sql-server">sql dump files or to intercept the communication</a>. </p>
  
  <p>The interception itself doesn’t seem to be a problem as discussed <a href="https://www.mssqltips.com/sqlservertip/2436/what-does-my-sql-server-data-look-like-over-the-wire/" rel="nofollow noreferrer">here</a>. But I wonder how can the mirror reply.</p>
  
  <p>The same goes for port mirroring using [TCP packet hijacking] (<a href="https://reverseengineering.stackexchange.com/a/1816">https://reverseengineering.stackexchange.com/a/1816</a>)</p>
  
  <p>To sum up, my questions are as follows:</p>
  
  <ol>
  <li>Is that feasible approach to achieve smooth transition from a legacy modifiable solution to new one?</li>
  <li>If my idea is doable, how can I listen to db requests and create responses from a different application and not the original db?</li>
  <li>Is there a better way how to achieve my goal which is to create new database with database abstraction layer so the old legacy application will remain functional?</li>
  </ol>