Page 1 of 1

SQL Express 2005 and Vista

Posted: Sun Sep 21, 2008 10:17 pm
by Linuxman
We have a program and during the installation we are running an SQL script to install a database and some preliminary data. When we run the installation on Vista it errors out and will not allow the database or tables to be installed because of some permissions. I have found some postings on the INET about going into management studio (sql) and altering the user permissions or CP to create a new user. This is not reasonable for most of our clients, has anyone found a work around to this issue? thanks in advance for any information.

Posted: Tue Sep 30, 2008 8:45 pm
by Linuxman
Is there someone who has been through this situation, we still have not resolved it.

copy the backup file into the dada directory

Posted: Tue Oct 21, 2008 3:15 am
by ulrichard
Hi Linuxman,

I had a similar problem with Vista not allowing me to restore a backup of an initial database from $SUPPORTDIR$.
What I do, although it's not so nice, is copying the backup file into the data directory of the database I want to restore. In there the user rights are sufficient, so that the SQL Server service can restore the database.
To find the appropriate data directory, I have to query the registry :

Set Variable SqlDataDir to
Read Registry Key HKLM\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\\SQL\\PlDokV1 into SqlDataDir
Set Variable SqlDataDir to $PROGRAMFILES$Microsoft SQL Server\\$SqlDataDir$\\MSSQL\\data
Call DLL Function kernel32.dll->CopyFileA
Microsoft SQL Server Script : Connect to database master on instance (local)\\PlDokV1 as user sa (get result into variable SQLSUCCESS)


Rgds
Richard