One of my fellow testers is having a problem starting the SQL Server Query Analyzer on (one of) her system(s).
Originally, she had the sCmdLine in the SQL Query Analyzer's MainWin declaration set to bring it up on her primary computer. On that box, it's SQL 8 (aka SQL 2000). She has another box she wants to start it on, but on that box it's SQL 7 and its in a different directory.
As far as we can tell, the window declarations on both version of Query Analyzer are identical.
My first thought was, create an Invoke() inside the MainWin declaration. In that, check a flag to see which directory she should run SQL Query Analyzer from, and use SYS_Execute to run it.
Problem with that is that it starts the Query Analyzer OK but never seems to return from the SYS_Execute call, so it then she cannot fill out the text fields in the ConnectToServer dialog that Query Analyzer brings up.
As the help indicates, yes, it shouldn't return until the called process exits. OK, so how exactly _do_ we start this program and feed it some data?
We also tried the .Start method, but it doesn't seem to fare any better.
Worst case, I'll create her some DSNs for the two instances of the database, and just call the SQL stored procedure from code. But all her other code works, if we could just figure out how to start the (basically) same program from two different locations (depending on which machine it's running on).
It turned out to be one of those stupid problems. The window declarations are _identical_...except for the title bar. In one case, it's "SQL Query Analyzer", in the other it's "SQL Server Query Analyzer". We put an asterisk at the appropriate place in the tag, and that fixed it.
In the meantime, we changed sCmdLine to just "isqlw.exe" and let it find the path, and since both machines have the path set correctly, this works fine too.