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

SQL Scripts view

thanks to the help in this board, I was able to customize the SQLServerSelectLogin2 dialog and add a browse button where the user can choose a directory path for the database location.
Now, I have just realized that there is not a way to specify the database location in the SQL Scripts views of Installshield.

can anyone point me to how I can customize the location of the database when Installshield creates it (i.e. the "Create Catalog if Absent" checkbox is checked.)

Thanks!
Labels (1)
0 Kudos
(5) Replies
hidenori
Level 17

You need to uncheck the "Create Catalog if Absent" checkbox, and add a script that will create a database catalog using the CREATE DATABASE statement. The script may need to be scheduled to run at login.
0 Kudos
peakbagger66
Level 4

hidenori wrote:
You need to uncheck the "Create Catalog if Absent" checkbox, and add a script that will create a database catalog using the CREATE DATABASE statement. The script may need to be scheduled to run at login.


Thanks, hidenori, once again.

I had come to this conclusion but was hoping for another way - I had seen reference to Installshield Express making use of the [DATABASEDIR] property. I see this in the string editor - Identifier IDS__DatabaseFolder_DatabaseDir using [DATABASEDIR] as avalue. Is this not used at all in Installshield Pro?

Thanks!
0 Kudos
hidenori
Level 17

[DATABASEDIR] is available in InstallShield Pro. In order to use the property in your SQL script, you need to use the Text Replacement functionality available in the SQL Scripts view. The following is a sample Text Replacement entry that will replace %DatabaseDir% with the value of the DATABASEDIR property in a SQL script:

Find What: %DatabaseDir%
Replace With: [DATABASEDIR]

and you need to change your SQL script like this:
CREATE DATABASE Sales
ON
( NAME = Sales_dat,
FILENAME = '%DatabaseDir%saledat.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = Sales_log,
FILENAME = '%DatabaseDir%salelog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB ) ;
GO

Hope that helps.
0 Kudos
zawmintun
Level 2

I import script file at sql scripts view.
First time I run install scripts , it's doesn't work.
But I run next time,it's run.
Why sql scripts file doesn't work at first time.
Please help me!
0 Kudos
hidenori
Level 17

zawmintun,

Do you receive any SQL scripting error at the initial install? What project type are you using?
0 Kudos