PDA

View Full Version : Newbie question - creating database



SteveHampshire
07-05-2005, 06:20 AM
Please excuse what will probably be a really elementary question to many of you. I am trying to create a database within a data sub-dir of my application target directory (TARGETDIR\Data), and having trouble.

I'vw copied the example SQL database creation script, and used text replacement to put the mdf and ldf files in <TARGETDIR>\DATA. I run the script During Install, but it fails every time unless I create the <TARGETDIR>\Data in advance. If I do that it works fine.

<TARGETDIR>\Data is configured in the "Application data" section, and my install does create it, but it looks like it doesnt do so until after the SQL script has run.

Is there any way of controlling the install order so that the target dir will exist when my SQL script tries to use it?