SQL Express 2005 and Vista

Got a problem you cannot solve? Try here.
Post Reply
Linuxman
Posts: 27
Joined: Wed May 18, 2005 10:36 pm

SQL Express 2005 and Vista

Post 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.
Linuxman
Posts: 27
Joined: Wed May 18, 2005 10:36 pm

Post by Linuxman »

Is there someone who has been through this situation, we still have not resolved it.
ulrichard
Posts: 150
Joined: Thu Dec 27, 2007 5:45 am
Location: Switzerland
Contact:

copy the backup file into the dada directory

Post 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
Post Reply