cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
elmtree111
Level 5

Problem of create SQLExpress database on vista

Now i'm working on a installsheild project.
I wanna run script to create a SQLExpress database during installation. At the point of running script, the debugger stepped in and told me there was an error opening the database connection:
"CREATE DATABASE permission denied in database 'master'................."

And my script like: osql -S localhost\SQLExpress -E -i "C:\a.sql"

How could i give the permission? and how to do it?
thanks for any help
Labels (1)
0 Kudos
(4) Replies
thepeter
Level 7

why don't you use the InstallShield builtin SQL Scripts support? I never had a problem with it.
It seems that the user running the installer doesn't have permissions over that SQL instance. or there's a problem with your osql syntax; try using "(local)\SQLExpress" instead of "localhost\SQLExpress".
0 Kudos
elmtree111
Level 5

thanks peter,i use builtin SQL Scripts and it can create database now.

But how can i control the execute sequence? i want to install sqlexpress first and then run script. Now when i run the installer, connect database server dialog come out before the sqlexpress install. i'm working on a installscript project.who knows how to control the run sequence. (i chose script files are belonged to the last application,but the database server dialog still runs first).
thanks for any help or ideas
0 Kudos
thepeter
Level 7

I have not used InstallScript projects before. I assume you call the installation of SQLExpress from a function in the InstallScript? Then use an event handler that gets executed at the very beginning of the Installation Sequence. Here is some help: http://helpnet.acresso.com/robo/projects/devstudio9helplangref/LangrefEventHandlers.htm
0 Kudos
elmtree111
Level 5

thank you very much peter,now it works.
0 Kudos