trap errors/exceptions occured while running exe through commandline
-
In my application I am using Shellexecute to run SQLs through isql.exe. I want to trap the exceptions/errors which isql throughs in messagebox dialogs. Can I trap those messages anyway out.:confused: Souchakra
Try using SQL Server 2000 commandline tool osql which is the recommended tool for running sql scripts on commandline (if you not need to connect to SQL Server 6.5 or before). All sql server 2000 commandline tool output errors on stdout/stderr and there should be no message box at least. To catch the output it is a good idea to use the -o switch which directs it to the given file. (For more options see sql server 2000 online help "Using the SQL Server Tools) Possibly the messagebox may occur because ShellExecute is used and has this (configured?) effect for the case of a stderr output?
-
Try using SQL Server 2000 commandline tool osql which is the recommended tool for running sql scripts on commandline (if you not need to connect to SQL Server 6.5 or before). All sql server 2000 commandline tool output errors on stdout/stderr and there should be no message box at least. To catch the output it is a good idea to use the -o switch which directs it to the given file. (For more options see sql server 2000 online help "Using the SQL Server Tools) Possibly the messagebox may occur because ShellExecute is used and has this (configured?) effect for the case of a stderr output?