Home All Groups Group Topic Archive Search About

isqlw.exe from a console app

Author
10 Aug 2006 9:25 PM
Jayyde
Can someone who knows a lot more about this than me please tell why, when
the following code executes, I get a pop-up window telling me the usage of
isqlw.exe?

<code>

strQueryCommandPath = "C:\\Program Files\\Microsoft SQL
Server\\80\\Tools\\Binn\\";

strArguments = "-S(local)\\SQLEXPRESS ";

strArguments += "-Usa ";

strArguments += "-Padminmlc ";

strArguments += "-i" + strCurrentDir + strFileName + " ";

myProcess.StartInfo.WorkingDirectory = strQueryCommandPath;

myProcess.StartInfo.FileName = "ISQLW.EXE";

myProcess.StartInfo.Arguments = strArguments;

myProcess.StartInfo.UseShellExecute = false;

return myProcess.Start();

</code>



I've also tried it with a space in between the - switch and also with quotes
around the switch arguments.  I've put the entire path in just the
StartInfo.FileName instead of switching the working directory as well.  I
can't for the life of me get it to actually fire off this command for some
reason.

p.s. I've also tried using "/"s instead of "-"s as well.

Author
10 Aug 2006 10:47 PM
Erland Sommarskog
Jayyde (a***@hotmail.com) writes:
Show quote
> Can someone who knows a lot more about this than me please tell why, when
> the following code executes, I get a pop-up window telling me the usage of
> isqlw.exe?
>
><code>
>
> strQueryCommandPath = "C:\\Program Files\\Microsoft SQL
> Server\\80\\Tools\\Binn\\";
>
> strArguments = "-S(local)\\SQLEXPRESS ";
>
> strArguments += "-Usa ";
>
> strArguments += "-Padminmlc ";
>
> strArguments += "-i" + strCurrentDir + strFileName + " ";

This is my prime suspect. Change this to:

Show quote
> strArguments += "-i\"" + strCurrentDir + strFileName + "\" ";



--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
11 Aug 2006 4:01 AM
cn.popeye
you can using /o argment, out put file save execute sql script info.
for exmple.
sql = 'isql -S '+server +' -d '+dbname+' -U '+us+' -P '+pwd+' -i
"'+path+'" -o "'+path+'.log'+'"'



"Erland Sommarskog" <esq***@sommarskog.se>
??????:Xns981C8213D31BYazorman@127.0.0.1...
Show quote
> Jayyde (a***@hotmail.com) writes:
>> Can someone who knows a lot more about this than me please tell why, when
>> the following code executes, I get a pop-up window telling me the usage
>> of
>> isqlw.exe?
>>
>><code>
>>
>> strQueryCommandPath = "C:\\Program Files\\Microsoft SQL
>> Server\\80\\Tools\\Binn\\";
>>
>> strArguments = "-S(local)\\SQLEXPRESS ";
>>
>> strArguments += "-Usa ";
>>
>> strArguments += "-Padminmlc ";
>>
>> strArguments += "-i" + strCurrentDir + strFileName + " ";
>
> This is my prime suspect. Change this to:
>
>> strArguments += "-i\"" + strCurrentDir + strFileName + "\" ";
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button