Subject | Re: ISQL not executing when launched from Delphi or Wise Install |
---|---|
Author | homerjones1941 |
Post date | 2011-01-03T02:41:22Z |
I knew it had to be simple. I neglected to change to the directory where the script file was located. See the ChDir command in the Delphi code below. Problem solved unless someone has a better way. Thanks.
procedure TForm1.Button1Click(Sender: TObject);
begin
ChDir('C:\ABSFIREBIRD\SQLTEST');
WinExec('isql -i MyScript.sql',SW_SHOWNORMAL);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ChDir('C:\ABSFIREBIRD\SQLTEST');
WinExec('isql -i MyScript.sql',SW_SHOWNORMAL);
end;
--- In firebird-support@yahoogroups.com, "homerjones1941" <homer@...> wrote:
>
> After reading The Firebird Book, and searching Google a number of different ways, I figure I'm missing something simple.
>
> I used IBExpert to make a "Create Database" DDL script. When I use that script with ISQL from the Windows command line, it creates the expected database file. Because the script didn't work as expected when launched by Delphi or Wise, I created a batch file that also works fine from command line or when double clicked. However, when I launch the batch file (or isql) from Delphi or Wise, the command window just flashes and the script does not run.
>
> More Info:
>
> The batch file contains only one line:
> isql -i abs3db.sql
> In an attempt to see why it wasn't working I changed the command to:
> isql -e -i abs3db.sql
> When I ran this batch file from CMD it worked as expected, giving a mile of echoed commands, and created the DB.
>
> In Delphi I've used WinExec, ShellExecute, and CreateProcess. In every case the Command Window just flashes but isql doesn't launch and the script doesn't run.
>
>
> OS: Windows XP Pro.
> Delphi 2007.
> Wise Install Builder 7.X
>
> I suspect my problem is not with ISQL, but with how I am launching it, although its behavior is identical in both Wise and Delphi. I hope someone else has run into this.
>