I’m looking for a method to intercept SQL commands initiated by a third-party program. Specifically, I need to monitor a legacy Visual Basic 6 application that communicates with SQL Server 2005. For instance, when the program populates a grid, I want to identify the exact SQL query that was used to retrieve the data.
In a past project, I encountered a similar challenge with a legacy application. I employed SQL Server Profiler, which allowed me to capture the SQL commands in real time without modifying the application itself. Additionally, configuring ODBC logging proved useful when profiler was not an option. The key is to monitor the traffic on the port SQL Server uses, and this can sometimes be achieved by intercepting network communications if necessary. The precise setup will depend on connection details and your environment, so make sure to test configurations in a safe place first.
hey, try setting up a tcp proxy to capture the sql packet traffic. its a hack, but showed me exact queries from a legacy vb app without alterin the code. might take some fiddlin with config to work
In a project involving an outdated application, I found that enabling built-in logging features on the data access layer was an effective solution. Adjusting the ADO or ODBC driver configuration allowed the application to generate trace files containing the queried SQL statements. Although this method may require extra administrative configuration and careful testing in a non-production environment, it provided both the query details and performance metrics essential for diagnosing issues. This approach, while slightly intrusive, often offers a clear view of the underlying operations without needing external interception tools.
hey, hav u thought abt a local proxy that wraps the odbc call? i trued something similiar once with mixed results. how about u tweak the connection layer to snatch the query? what other approaches have u considered?