0

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

It is coupled so tightly, that it does not even work with views instead of tables as suggested here. So the present situation look like this: current situation diagram

Currently I am trying to research into the problem and find my options. I have some idea that might work:

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.

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.

Diagram of intercepted communication

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.

They discuss approach how to either dig commands from sql dump files or to intercept the communication.

The interception itself doesn’t seem to be a problem as discussed here. But I wonder how can the mirror reply.

The same goes for port mirroring using [TCP packet hijacking] (https://reverseengineering.stackexchange.com/a/1816)

To sum up, my questions are as follows:

  1. Is that feasible approach to achieve smooth transition from a legacy modifiable solution to new one?
  2. If my idea is doable, how can I listen to db requests and create responses from a different application and not the original db?
  3. 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?
JaK
  • 66
  • 1
  • 9
  • Use or lack of views does not make a db "correct" if you're worried that sql 2008 is old, you can probably install a newer version and the app will continue to work. What is it that you're actually concerned about? What is your goal? – Andy Mar 08 '18 at 02:49
  • Application work only with this particular version of sql. I wan't to upgrade it to newer version and change its structure without changing the application. – JaK Mar 08 '18 at 13:00
  • How do you know it only works with that particular version? Is it doing some kind of version check? There can be breaking changes in SQL Server, but they are rare, and you can keep the DB at a lower compatibility level to avoid some of them. Frankly, what your proposing in your question sounds like a terrible idea and not worth the effort. So again, what exactly is it that you need to do? Just get off a version of SQL no longer supported, or something else? – Andy Mar 13 '18 at 23:45

0 Answers0