cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
heko_76
Level 4

Cmd file and SQL Script

I am executing a cmd file to run a sql script inside it.
When i run the cmd file through the command prompt it runs well and executes the script.But when i execute it in the installshield with the following code.It doesnt work....

Any ideas i am using installshield professional 2008 on windows vista and SQL Express edition 2005 SP2.I am unable to find what is the problem....grrrr.Please help
The cmd file contains one line:
sqlcmd.exe -i test.sql -S (local)\sqlexpress

I am using the following code:
if (BatchFileLoad (SUPPORTDIR ^ "\\test.cmd") < 0) then
MessageBox ("Unable to load test.cmd",SEVERE);
else
BatchSetFileName (SUPPORTDIR ^ "\\test.cmd");
szLine = "sqlcmd.exe -i test.sql -S (local)\sqlexpress";
szRefKey = "";
nOptions = AFTER | COMMAND;
if (EzBatchAddString (szLine, szRefKey, nOptions) < 0) then
MessageBox ("Second call to EzBatchAddString failed.", SEVERE);
else
MessageBox ("Second call to EzBatchAddString successful.", INFORMATION);
endif;
endif;
Labels (1)
0 Kudos
(1) Reply
cbragg
Level 7

CMD files are old and ugly. Do you realise that Installshield supports native SQL scripts?
0 Kudos