Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Wednesday, March 28, 2012

persistent SQLBrowser error eventID 3

I have what looks like a completed install of SQL Server Express Edition, accomplished via unattended setup as part of a custom application (on a machine hereafter dubbed Machine "A").

So far, though, I can't access this instance from a remote SQL Server Management Studio because SSMSE can't see the installed database engine.

I've verified that:

The SQL Server Express installation on Machine A has remote connections enabled.

The SQLBrowser on Machine A is enabled and running.

Machine A's Windows Firewall is disabled.

Using a test tool, I can see that UDP messages sent to SQLBrowser (on port 1434), arrive (i.e. it complains about their format in the System Log).

It seems that Machine A's SQLBrowser isn't responding to requests, but there's no obvious reason why.

There's one clue in Machine A's event log:

Whenever SQLBrowser is started or restarted, there's a warning in the App Log:

"The configuration of the AdminConnection\TCP protocol in the SQL instance SQLEXPRESS is not valid." (eventid 3).

Any help will be much appreciated.

Thanks in advance
Josh

Some more diverse testing reveals that the problem seems to occur only when SSMSEE is running on Windows 2000.

The source of the problem appears to be that W2K is not picking up the correct instance name (in other words, it puts MYSERVER in the list of engines, but not MYSERVER\SQLEXPRESS). If I key in MYSERVER\SQLEXPRESS by hand, things work as expected.

Incidentally, I noticed that when running under XP, the Network Server list shows which version of the SQL Engine is running on each server, but under Windows 2000, it does this only for very few of the servers.

Is this a shade of a known problem?

Josh

Monday, March 26, 2012

Permit to connectting SQL Server 2005 Express only at specific client ip.

Hi, how can I set SQL Server 2005 Express to permit only specific client ip? Is this possible using T-SQL?

This is not possible using SQL Server or T-SQL.

You may be able to limit the connecting clients by using IPSEC or SSL.

|||Hi,

there is a property which is called Applicationname which can be retrievedt hrough the APP_NAME() function. But be aware, one can change that by just manipulating the connectin string, so if you read this anywhere on the web, that this "security feature" can be used to check the application name, just ignore it.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||And many 'custom' applications do not provide an AppName.

Friday, March 23, 2012

permissions sql express and remote connection problems TIA

posted to the forums a few weeks ago, followed the suggestion but the problem has not been squared, the link for my original post is at the bottom of this message.

have tried most of the suggestions in the forums, again see the link for details on steps i have tried, kept poking around and came up with a few more possibilities for the problem,

the error message is the one that says sql server express remote connnections are not enabled by default during the install of sql express,

backed up a little and it seems i can not even connect to the local machine, i ran the sqlcmd -s -e \sqlexpress and the login timesouts and says that sql express refused the connection, have shared memory protocal and tcp/ip running also tried it with named pipes,

so that left me wonderin if maybe permission for sql express need to be adjusted, brought up SQL server Studio Mangement Express console and went to the only express instance on the local machine, brought up properties for \sqlexpress and went to the permission section and noticed the following:

for the BuiltIn\administrator and builtIn\User account the only permission that is checked off is the "Conect SQL" which has only the Grant checkbox checked, also the grantor is sa, btw what does the checkbox With Grant do? this was the same for the both accounts,

for the public account the only permission that is enabled is the View any database,

are there other permission which need to be granted or "with granted", also i assume i should not be using the sa account or should i?

other things going on include include Visual Studio 2005, i am able to get to the database thru Server Explorer, and can bring up the tables and see them, sometimes thos their is a red x on the mdf, but when i click it brings them up.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=217258&SiteID=1

Are you using a named instance? What instance names do you have in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL?

"sqlcmd -E -S \sqlexpress" will work only if the main instance is called sqlexpress, if it is called differently, then you have to use that name.

Have you ever been able to connect locally with sqlcmd? Let's figure out first what's wrong with the local connection, and then we can investigate the remote issues.

Thanks
Laurentiu

|||

Thanks Lauretiu, check the registry and it looks alright, the keys are below:

name SQLexpress

type reg_sz

data mssql.1

not sure if i have ever connected locally, have never been able to get either the sqlcmd -e -s \sqlexpress to work, or the aspnet_regsql wixard to work, (is ther anothe way to test the local connection?) for the sqlcmd i get a get a message like this,

HResult 0x274D, Level 16, State 1
TCP Provider: No connection could be made because the target machine actively refused it

sqlcmd: Error Microsoft sql native client :an error has occurred while establishing a connection th the server. When conecting th SQL server 2005, this failure may be caused by the fact that unde rth edefault settings sql server does not allow remote connecitons. and the a login timeout expired.

the server has a different ip address than the laptop itself.

the aspnet_regsql error message is very similar,

|||

Here's a link that discusses some connection failures and mentions the 0x274D error:

http://blogs.msdn.com/sql_protocols/archive/2005/09/28/474698.aspx

According to Peter, one of the reasons for this message could be that TCP is not enabled. Could you check that the TCP protocol is enabled? You can use the Configuration Manager and look under SQL Server 2005 Network Configuration->Protocols for SQLEXPRESS. I'll see if I can find anything else about this error.

Thanks
Laurentiu

|||

This may be just a typo in the post but the correct syntax for the sqlcmd command run on the same machine where SQL Express runs is:

sqlcmd -E -S .\sqlexpress

Note:

- the capital -E and -S (the case matters in the option selection)

- the dot before the \ character

In your original post you mentioned that the SQL Express lists port 1232 under IPAll. If you get the same error ("TCP Provider: No connection could be made because the target machine actively refused it") after running the above sqlcmd statement, you can troubleshoot it by running:

telnet <machineName> 1232

- replace <machineName> with the actual name of your machine.

- if it fails with an error similar to "Could not open connection to the host" it means SQL Express is not configured for TCP, and may need to be restarted.

- if it gives you a blank screen it means it connected, and you should be able to connect through

sqlcmd -E -S tcp:.\sqlexpress,1232

|||

Hey Peter thank

it was the capital -S that was causing the problem, a weeks delay over a cap, should know better by now, thanks again, take care

Wednesday, March 21, 2012

Permissions on stored procedures

Using Server Management Studio Express and SQL Server 2005 Express - is it possible to assign Exec permissions for users on a sproc by sproc basis. If so, how do I do this?

TIA

--
Mike BrindOk - I've found out how to do it. Just run a GRANT command in the Query Pane on the chosen procedure for the selected user.
sql

Permissions on a new stored procedure

Help!

I usually use SQL 2000 at work but upon deciding to work from home have installed and setup SQL express 2005. I use the management studio to write table and sps but for new sp I cannot find how to allow permission. I have been able to allow permission for all sps on the database I restored that I am now working on and have successfully allocated permissions to a new table but cannot do the same with the sp. The sp is viewable in the database but permission is denied when attempting to execute via my ASP script.

Any ideas?

Error Type:
Microsoft SQL Native Client (0x80040E09)
EXECUTE permission denied on object 'procBannerSlotList', database 'HotLizardWebsite', schema 'dbo'.

It seems after all this time I've managed to work it out for myself - so for anyone out there not aware of the solution - the solution is this:

In the database security - right click the role you wish permissions to be set for. Go to the Securables section, click Add and just add all objects belonging to dbo - I then just removed the dt prefixed objects that were not relevant - sp permissions now fully operational

Tuesday, March 20, 2012

Permissions issue?

I have a SQL Server 2005 Express db on my local machine for testing and I'm
using Dreamweaver 8 to connect to it. No problem. However.. when I try out
a page on localhost through a browser, I get this message:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
"Linker_app" requested by the login. The login failed.
/linkerapp/login.asp, line 24
That would usually be a permissions issue, but I found the database and
allowed the Internet Guest Account to access it . .but the message is still
there.
Can someone tell me what I'm doing wrong?
Many thanks!
Nancy
Here are some Express links that might come in handy. I would check to
ensure it allows remote connections and that the db is open.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sseoverview.asp
Express Overview
http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
with MSDE
http://msdn.microsoft.com/sql/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp
User Instances
http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
for Remote Access
https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
Configuring Remote Access
http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
remote access
http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/emsqlexcustapp.asp
Embedding Express in Apps
http://blogs.msdn.com/rogerwolterblog/archive/2006/04/13/575974.aspx
Backing up Express
Andrew J. Kelly SQL MVP
"Nancy" <nancy@.webwish.com> wrote in message
news:eYRSl$oZHHA.3928@.TK2MSFTNGP03.phx.gbl...
>I have a SQL Server 2005 Express db on my local machine for testing and I'm
>using Dreamweaver 8 to connect to it. No problem. However.. when I try
>out a page on localhost through a browser, I get this message:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database
> "Linker_app" requested by the login. The login failed.
> /linkerapp/login.asp, line 24
>
> That would usually be a permissions issue, but I found the database and
> allowed the Internet Guest Account to access it . .but the message is
> still there.
> Can someone tell me what I'm doing wrong?
> Many thanks!
> Nancy
>
|||got it .. thank you for the excellent links .. I have bookmarked many of
them.
Nancy
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:ujFpbbsZHHA.4368@.TK2MSFTNGP06.phx.gbl...
> Here are some Express links that might come in handy. I would check to
> ensure it allows remote connections and that the db is open.
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sseoverview.asp
> Express Overview
> http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
> with MSDE
> http://msdn.microsoft.com/sql/default.aspx?pull=/library/en-us/dnsse/html/sqlexpuserinst.asp
> User Instances
> http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
> for Remote Access
> https://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
> Configuring Remote Access
> http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
> remote access
> http://msdn.microsoft.com/sql/express/default.aspx?pull=/library/en-us/dnsse/html/emsqlexcustapp.asp
> Embedding Express in Apps
> http://blogs.msdn.com/rogerwolterblog/archive/2006/04/13/575974.aspx
> Backing up Express
> --
> Andrew J. Kelly SQL MVP
> "Nancy" <nancy@.webwish.com> wrote in message
> news:eYRSl$oZHHA.3928@.TK2MSFTNGP03.phx.gbl...
>

Permissions issue?

I have a SQL Server 2005 Express db on my local machine for testing and I'm
using Dreamweaver 8 to connect to it. No problem. However.. when I try out
a page on localhost through a browser, I get this message:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open datab
ase
"Linker_app" requested by the login. The login failed.
/linkerapp/login.asp, line 24
That would usually be a permissions issue, but I found the database and
allowed the Internet Guest Account to access it . .but the message is still
there.
Can someone tell me what I'm doing wrong?
Many thanks!
NancyHere are some Express links that might come in handy. I would check to
ensure it allows remote connections and that the db is open.
http://msdn.microsoft.com/library/d...r />
rview.asp
Express Overview
http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
with MSDE
http://msdn.microsoft.com/sql/defau... />
erinst.asp
User Instances
http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
for Remote Access
https://blogs.msdn.com/sqlexpress/a.../05/415084.aspx
Configuring Remote Access
http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
remote access
http://msdn.microsoft.com/sql/expre...qlexcustapp.asp
Embedding Express in Apps
http://blogs.msdn.com/rogerwolterbl.../13/575974.aspx
Backing up Express
Andrew J. Kelly SQL MVP
"Nancy" <nancy@.webwish.com> wrote in message
news:eYRSl$oZHHA.3928@.TK2MSFTNGP03.phx.gbl...
>I have a SQL Server 2005 Express db on my local machine for testing and I'm
>using Dreamweaver 8 to connect to it. No problem. However.. when I try
>out a page on localhost through a browser, I get this message:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open dat
abase
> "Linker_app" requested by the login. The login failed.
> /linkerapp/login.asp, line 24
>
> That would usually be a permissions issue, but I found the database and
> allowed the Internet Guest Account to access it . .but the message is
> still there.
> Can someone tell me what I'm doing wrong?
> Many thanks!
> Nancy
>|||got it .. thank you for the excellent links .. I have bookmarked many of
them.
Nancy
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:ujFpbbsZHHA.4368@.TK2MSFTNGP06.phx.gbl...
> Here are some Express links that might come in handy. I would check to
> ensure it allows remote connections and that the db is open.
> http://msdn.microsoft.com/library/d.../>
verview.asp
> Express Overview
> http://msdn2.microsoft.com/en-us/library/ms165672.aspx Comparing Express
> with MSDE
> http://msdn.microsoft.com/sql/defau...>
userinst.asp
> User Instances
> http://www.datamasker.com/SSE2005_NetworkCfg.htm Configuring Express
> for Remote Access
> https://blogs.msdn.com/sqlexpress/a.../05/415084.aspx
> Configuring Remote Access
> http://www.kbalertz.com/Feedback_914277.aspx Configuring SQL2005 for
> remote access
> http://msdn.microsoft.com/sql/expre...qlexcustapp.asp
> Embedding Express in Apps
> http://blogs.msdn.com/rogerwolterbl.../13/575974.aspx
> Backing up Express
> --
> Andrew J. Kelly SQL MVP
> "Nancy" <nancy@.webwish.com> wrote in message
> news:eYRSl$oZHHA.3928@.TK2MSFTNGP03.phx.gbl...
>

Monday, March 12, 2012

Permissions and access to AdventureWorks

I have downloaded the Express Edition of SQL Server 2005 to try to learn the software to take the MCTS test for certification. I have installed the software and the SMS. I have downloaded the AdventureWorks database files and installed everything as directed. I use Windows authentication to log in (it's my own home PC). I have followed the instructions to attach the database to the instance I am using.

The problem I'm having is in trying to run examples from the book I'm using on the database. For example, I'm trying to run a simple query like "SELECT * FROM dbo.DatabaseLog;" When I click execute, I keep getting this message:

"

Msg 208, Level 16, State 1, Line 1

Invalid object name 'dbo.DatabaseLog'.

"

When I look at the Object Explorer pane, I can clearly see the table and see that I am spelling it correctly.

I have set my login up as the owner of the database and when I try to set up permissions on the table, I only see the roles [user] and [guest]. I tried setting up permissions for both, but that didn't help.

What am I doing wrong?

Thank you.

Eric S. Bauman

Be sure to be under the specific Northwind database context if you start the query. There is a dropdown in SSMS where you can change the context through the GUI. YOu can also change the context through the USE command e.g. USE Northwind or directly during connection time specifying Initital Catalog=Northwind in the connectionstring (you did not mention where you tried to execute the query)

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||Thank you, Jens. That did it. I opened up a new query window in SMS, typed in the USE command then typed in the query and it worked like a champ.

Thanks again for your help!

Eric Bauman

Wednesday, March 7, 2012

Permission to access dB problem in SQL Server 2005 Express from inside VS2005

I am trying to program a database from inside C++.NET via Visual
Studio 2005 using the ADO.NET set of classes, but this I believe is a
SQL Server 2005 Express permissions question under Windows XP
Professional OS.
In another thread, http://tinyurl.com/373lzx, I was able to open a
database successfully using VS2005 (thanks to a suggestion by Erland
Sommarskog). But subsequent to this I played around with the local
policy permissons while logged in as Administrator and may have
blocked access to this database. How to undo this? (I forgot what I
changed, but at the time it was pretty innocuous, and none of my other
programs have been affected).
Two problems really:
0/ though I can create and access a new database as a Power User, I
cannot access the old database anymore. Literally I have a red 'x'
next to the icon for the old database, and I get the error, under the
Server Explorer of Visual Studio 2005, when I right click "refresh" of
"Exception of the type 'System.Exception' was thrown".
1/ Switching to Administrator is no help (see below for the error),
but that also raises another question (see Q2 below)
2/ I played around with SQL Server 2005 Express Manager,and tried
adding various groups, but to no avail.
Question #1: how to undo this
Question #2: how to add "Admin" as an "object" or whatever you call
it under the SQL Server 2005 Express manager so I avoid the below
error (i.e., so Admin can access this dB).
Thank you.
RL
-
No connection the following error occurred: Unable to open the
physical file "C
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
\NEWPC_USERDCV_DB.mdf". Operating system error 32: "32(The process
cannot access the file because it is being
used by another process.)".
Unable to open the physical file "C:\Program Files\Microsoft SQL Server
\MSSQL.1
MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF". Operating system error 32:
"32(The process canot access the file because it is being used by
another process.)".
Cannot open database "NEWPC_USERDCV_DB" requested by the login. The
login failed.
Login failed for user 'PC_NAME-PC_USER\Administrator'.
File activation failure. The physical file name "C:\Program Files
\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF " may be incorrect.
Press any key to continue . . .
This article may help.
http://support.microsoft.com/kb/313222/en-us
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"raylopez99" wrote:
>I am trying to program a database from inside C++.NET via Visual
> Studio 2005 using the ADO.NET set of classes, but this I believe is a
> SQL Server 2005 Express permissions question under Windows XP
> Professional OS.
> In another thread, http://tinyurl.com/373lzx, I was able to open a
> database successfully using VS2005 (thanks to a suggestion by Erland
> Sommarskog). But subsequent to this I played around with the local
> policy permissons while logged in as Administrator and may have
> blocked access to this database. How to undo this? (I forgot what I
> changed, but at the time it was pretty innocuous, and none of my other
> programs have been affected).
> Two problems really:
> 0/ though I can create and access a new database as a Power User, I
> cannot access the old database anymore. Literally I have a red 'x'
> next to the icon for the old database, and I get the error, under the
> Server Explorer of Visual Studio 2005, when I right click "refresh" of
> "Exception of the type 'System.Exception' was thrown".
> 1/ Switching to Administrator is no help (see below for the error),
> but that also raises another question (see Q2 below)
> 2/ I played around with SQL Server 2005 Express Manager,and tried
> adding various groups, but to no avail.
> Question #1: how to undo this
> Question #2: how to add "Admin" as an "object" or whatever you call
> it under the SQL Server 2005 Express manager so I avoid the below
> error (i.e., so Admin can access this dB).
> Thank you.
> RL
> -
> No connection the following error occurred: Unable to open the
> physical file "C
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
> \NEWPC_USERDCV_DB.mdf". Operating system error 32: "32(The process
> cannot access the file because it is being
> used by another process.)".
> Unable to open the physical file "C:\Program Files\Microsoft SQL Server
> \MSSQL.1
> MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF". Operating system error 32:
> "32(The process canot access the file because it is being used by
> another process.)".
> Cannot open database "NEWPC_USERDCV_DB" requested by the login. The
> login failed.
> Login failed for user 'PC_NAME-PC_USER\Administrator'.
> File activation failure. The physical file name "C:\Program Files
> \Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF " may be incorrect.
> Press any key to continue . . .
>
|||On Apr 8, 11:04 am, "Dave Patrick" <DSPatr...@.nospam.gmail.com> wrote:
> This article may help.
> http://support.microsoft.com/kb/313222/en-us
>
Thanks but I was thinking of a less extreme fix.
I'm thinking there must be some way of 'unlocking' the old database.
The reason is, I figured out a workaround, in that I constructed the
same database from scratch, from inside of VS 2005 (i.e. mechanically
reconstructing the entire database), and the new, identical database
can now be accessed as before, from inside VS 2005, and the connection
works (refresh works, 'test connection' from Modify also works, and
the program accessing the new database). But the old database still
has a red "X" next to it, and refreshing does not work.
Just a weird aspect.
I've ordered some books on dB programming and maybe they'll have some
insight, but in general I'd like to know how to reset permissions and/
or fix such problems in the future (short of reconstructing the
database 'from scratch' as I did here)
RL

Permission to access dB problem in SQL Server 2005 Express from inside VS2005

I am trying to program a database from inside C++.NET via Visual
Studio 2005 using the ADO.NET set of classes, but this I believe is a
SQL Server 2005 Express permissions question under Windows XP
Professional OS.
In another thread, http://tinyurl.com/373lzx, I was able to open a
database successfully using VS2005 (thanks to a suggestion by Erland
Sommarskog). But subsequent to this I played around with the local
policy permissons while logged in as Administrator and may have
blocked access to this database. How to undo this? (I forgot what I
changed, but at the time it was pretty innocuous, and none of my other
programs have been affected).
Two problems really:
0/ though I can create and access a new database as a Power User, I
cannot access the old database anymore. Literally I have a red 'x'
next to the icon for the old database, and I get the error, under the
Server Explorer of Visual Studio 2005, when I right click "refresh" of
"Exception of the type 'System.Exception' was thrown".
1/ Switching to Administrator is no help (see below for the error),
but that also raises another question (see Q2 below)
2/ I played around with SQL Server 2005 Express Manager,and tried
adding various groups, but to no avail.
Question #1: how to undo this
Question #2: how to add "Admin" as an "object" or whatever you call
it under the SQL Server 2005 Express manager so I avoid the below
error (i.e., so Admin can access this dB).
Thank you.
RL
-
No connection the following error occurred: Unable to open the
physical file "C
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
\NEWPC_USERDCV_DB.mdf". Operating system error 32: "32(The process
cannot access the file because it is being
used by another process.)".
Unable to open the physical file "C:\Program Files\Microsoft SQL Server
\MSSQL.1
MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF". Operating system error 32:
"32(The process canot access the file because it is being used by
another process.)".
Cannot open database "NEWPC_USERDCV_DB" requested by the login. The
login failed.
Login failed for user 'PC_NAME-PC_USER\Administrator'.
File activation failure. The physical file name "C:\Program Files
\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF" may be incorrect.
Press any key to continue . . .This article may help.
http://support.microsoft.com/kb/313222/en-us
--
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"raylopez99" wrote:
>I am trying to program a database from inside C++.NET via Visual
> Studio 2005 using the ADO.NET set of classes, but this I believe is a
> SQL Server 2005 Express permissions question under Windows XP
> Professional OS.
> In another thread, http://tinyurl.com/373lzx, I was able to open a
> database successfully using VS2005 (thanks to a suggestion by Erland
> Sommarskog). But subsequent to this I played around with the local
> policy permissons while logged in as Administrator and may have
> blocked access to this database. How to undo this? (I forgot what I
> changed, but at the time it was pretty innocuous, and none of my other
> programs have been affected).
> Two problems really:
> 0/ though I can create and access a new database as a Power User, I
> cannot access the old database anymore. Literally I have a red 'x'
> next to the icon for the old database, and I get the error, under the
> Server Explorer of Visual Studio 2005, when I right click "refresh" of
> "Exception of the type 'System.Exception' was thrown".
> 1/ Switching to Administrator is no help (see below for the error),
> but that also raises another question (see Q2 below)
> 2/ I played around with SQL Server 2005 Express Manager,and tried
> adding various groups, but to no avail.
> Question #1: how to undo this
> Question #2: how to add "Admin" as an "object" or whatever you call
> it under the SQL Server 2005 Express manager so I avoid the below
> error (i.e., so Admin can access this dB).
> Thank you.
> RL
> -
> No connection the following error occurred: Unable to open the
> physical file "C
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
> \NEWPC_USERDCV_DB.mdf". Operating system error 32: "32(The process
> cannot access the file because it is being
> used by another process.)".
> Unable to open the physical file "C:\Program Files\Microsoft SQL Server
> \MSSQL.1
> MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF". Operating system error 32:
> "32(The process canot access the file because it is being used by
> another process.)".
> Cannot open database "NEWPC_USERDCV_DB" requested by the login. The
> login failed.
> Login failed for user 'PC_NAME-PC_USER\Administrator'.
> File activation failure. The physical file name "C:\Program Files
> \Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF" may be incorrect.
> Press any key to continue . . .
>|||On Apr 8, 11:04 am, "Dave Patrick" <DSPatr...@.nospam.gmail.com> wrote:
> This article may help.
> http://support.microsoft.com/kb/313222/en-us
>
Thanks but I was thinking of a less extreme fix.
I'm thinking there must be some way of 'unlocking' the old database.
The reason is, I figured out a workaround, in that I constructed the
same database from scratch, from inside of VS 2005 (i.e. mechanically
reconstructing the entire database), and the new, identical database
can now be accessed as before, from inside VS 2005, and the connection
works (refresh works, 'test connection' from Modify also works, and
the program accessing the new database). But the old database still
has a red "X" next to it, and refreshing does not work.
Just a weird aspect.
I've ordered some books on dB programming and maybe they'll have some
insight, but in general I'd like to know how to reset permissions and/
or fix such problems in the future (short of reconstructing the
database 'from scratch' as I did here)
RL

Permission to access dB problem in SQL Server 2005 Express from inside VS2005

I am trying to program a database from inside C++.NET via Visual
Studio 2005 using the ADO.NET set of classes, but this I believe is a
SQL Server 2005 Express permissions question under Windows XP
Professional OS.
In another thread, http://tinyurl.com/373lzx, I was able to open a
database successfully using VS2005 (thanks to a suggestion by Erland
Sommarskog). But subsequent to this I played around with the local
policy permissons while logged in as Administrator and may have
blocked access to this database. How to undo this? (I forgot what I
changed, but at the time it was pretty innocuous, and none of my other
programs have been affected).
Two problems really:
0/ though I can create and access a new database as a Power User, I
cannot access the old database anymore. Literally I have a red 'x'
next to the icon for the old database, and I get the error, under the
Server Explorer of Visual Studio 2005, when I right click "refresh" of
"Exception of the type 'System.Exception' was thrown".
1/ Switching to Administrator is no help (see below for the error),
but that also raises another question (see Q2 below)
2/ I played around with SQL Server 2005 Express Manager,and tried
adding various groups, but to no avail.
Question #1: how to undo this
Question #2: how to add "Admin" as an "object" or whatever you call
it under the SQL Server 2005 Express manager so I avoid the below
error (i.e., so Admin can access this dB).
Thank you.
RL
-
No connection the following error occurred: Unable to open the
physical file "C
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
\NEWPC_USERDCV_DB.mdf". Operating system error 32: "32(The process
cannot access the file because it is being
used by another process.)".
Unable to open the physical file "C:\Program Files\Microsoft SQL Server
\MSSQL.1
MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF". Operating system error 32:
"32(The process canot access the file because it is being used by
another process.)".
Cannot open database "NEWPC_USERDCV_DB" requested by the login. The
login failed.
Login failed for user 'PC_NAME-PC_USER\Administrator'.
File activation failure. The physical file name "C:\Program Files
\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF" may be incorrect.
Press any key to continue . . .This article may help.
http://support.microsoft.com/kb/313222/en-us
Regards,
Dave Patrick ...Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"raylopez99" wrote:
>I am trying to program a database from inside C++.NET via Visual
> Studio 2005 using the ADO.NET set of classes, but this I believe is a
> SQL Server 2005 Express permissions question under Windows XP
> Professional OS.
> In another thread, http://tinyurl.com/373lzx, I was able to open a
> database successfully using VS2005 (thanks to a suggestion by Erland
> Sommarskog). But subsequent to this I played around with the local
> policy permissons while logged in as Administrator and may have
> blocked access to this database. How to undo this? (I forgot what I
> changed, but at the time it was pretty innocuous, and none of my other
> programs have been affected).
> Two problems really:
> 0/ though I can create and access a new database as a Power User, I
> cannot access the old database anymore. Literally I have a red 'x'
> next to the icon for the old database, and I get the error, under the
> Server Explorer of Visual Studio 2005, when I right click "refresh" of
> "Exception of the type 'System.Exception' was thrown".
> 1/ Switching to Administrator is no help (see below for the error),
> but that also raises another question (see Q2 below)
> 2/ I played around with SQL Server 2005 Express Manager,and tried
> adding various groups, but to no avail.
> Question #1: how to undo this
> Question #2: how to add "Admin" as an "object" or whatever you call
> it under the SQL Server 2005 Express manager so I avoid the below
> error (i.e., so Admin can access this dB).
> Thank you.
> RL
> -
> No connection the following error occurred: Unable to open the
> physical file "C
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA
> \NEWPC_USERDCV_DB.mdf". Operating system error 32: "32(The process
> cannot access the file because it is being
> used by another process.)".
> Unable to open the physical file "C:\Program Files\Microsoft SQL Server
> \MSSQL.1
> MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF". Operating system error 32:
> "32(The process canot access the file because it is being used by
> another process.)".
> Cannot open database "NEWPC_USERDCV_DB" requested by the login. The
> login failed.
> Login failed for user 'PC_NAME-PC_USER\Administrator'.
> File activation failure. The physical file name "C:\Program Files
> \Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\NEWPC_USERDCV_DB_log.LDF" may be incorrect.
> Press any key to continue . . .
>|||On Apr 8, 11:04 am, "Dave Patrick" <DSPatr...@.nospam.gmail.com> wrote:
> This article may help.
> http://support.microsoft.com/kb/313222/en-us
>
Thanks but I was thinking of a less extreme fix.
I'm thinking there must be some way of 'unlocking' the old database.
The reason is, I figured out a workaround, in that I constructed the
same database from scratch, from inside of VS 2005 (i.e. mechanically
reconstructing the entire database), and the new, identical database
can now be accessed as before, from inside VS 2005, and the connection
works (refresh works, 'test connection' from Modify also works, and
the program accessing the new database). But the old database still
has a red "X" next to it, and refreshing does not work.
Just a weird aspect.
I've ordered some books on dB programming and maybe they'll have some
insight, but in general I'd like to know how to reset permissions and/
or fix such problems in the future (short of reconstructing the
database 'from scratch' as I did here)
RL

Permission problems with sp_attach_db during installation

I successfully install SQL Express silently.

Then I try the following

-S .\INSTANCE -Q "sp_attach_db 'ATTACH_AS_NAME', 'C:\Program Files\APP_NAME\SQLData\APP_DB.MDF'"

This works...sometimes. But Many times I wll get a permissions error on the folder "C:\Program Files\APP_NAME". If I go and give "Everyone" "Full Permission" to the folder...it works fine.

My questions are:

1) What system users need access (and at what level) to this folder to do an attach? Because obviously giving everyone full access is bad.

2) Is there a better method for deploying a populated database with my application that this?

SQL service account needs modify privilege on "C:\Program Files\APP_NAME\SQLData\" path. If its running in Local system account then make sure SYSTEM or NT Authority \ System has modify privilege on the path
|||Do you know how to adjust the settings of that folder to allow that in a deployment package (Wise Install?)|||If you a trying to attach only the "mdf", use sp_attach_single_file_db and ignore your transaction log file(ldf)|||Hi,
1.) Click Start-->Run-->services.msc
2.) Check SQL Server startup account (Log On As)
3.) If its Local system then provide modify privilege for SYSTEM or NT Authority \ System for the folder "C:\Program Files\APP_NAME\SQLData\"
4.) If its some other ID provide modify privilege for the ID on "C:\Program Files\APP_NAME\SQLData\" folder.

Saturday, February 25, 2012

Permission Problem

Hello,
I have a problem with SQL Express.
I have a machine with SQL Express Instance installed correct.I did a copy of
the hard disk and installed this hard disk in another machine. Change the
name in the new machine.
My problem is with the user
SQLServer2005MSSQLUser$<COMPUTERNAME>$MSSQLSERVER, but the another
computernameHi Maria,
Copying the hard disk and placing it on another machine the way you have
done is going to cause you a whole host of problems especially if you
are part of a domain. You should NEVER do it this way. At best make a
syspreped image and then apply it to another computer. This way you can
have the system's SID regenerated.
Even then you should not just indiscriminately install applications
prior to syspreping and expect them to work on another machine. In your
case I think that the best thing for you to do is to uninstall SQL
Server and reinstall it.
Jonathan
Maria Paz wrote:
> Hello,
> I have a problem with SQL Express.
> I have a machine with SQL Express Instance installed correct.I did a copy of
> the hard disk and installed this hard disk in another machine. Change the
> name in the new machine.
> My problem is with the user
> SQLServer2005MSSQLUser$<COMPUTERNAME>$MSSQLSERVER, but the another
> computername

Permission Problem

Hello,
I have a problem with SQL Express.
I have a machine with SQL Express Instance installed correct.I did a copy of
the hard disk and installed this hard disk in another machine. Change the
name in the new machine.
My problem is with the user
SQLServer2005MSSQLUser$<COMPUTERNAME>$MSSQLSERVER, but the another
computernameHi Maria,
Copying the hard disk and placing it on another machine the way you have
done is going to cause you a whole host of problems especially if you
are part of a domain. You should NEVER do it this way. At best make a
syspreped image and then apply it to another computer. This way you can
have the system's SID regenerated.
Even then you should not just indiscriminately install applications
prior to syspreping and expect them to work on another machine. In your
case I think that the best thing for you to do is to uninstall SQL
Server and reinstall it.
Jonathan
Maria Paz wrote:
> Hello,
> I have a problem with SQL Express.
> I have a machine with SQL Express Instance installed correct.I did a copy
of
> the hard disk and installed this hard disk in another machine. Change the
> name in the new machine.
> My problem is with the user
> SQLServer2005MSSQLUser$<COMPUTERNAME>$MSSQLSERVER, but the another
> computername