This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Cmd file and SQL Script
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 11, 2008
04:50 AM
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;
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;
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Feb 11, 2008
04:55 AM
CMD files are old and ugly. Do you realise that Installshield supports native SQL scripts?