473,880 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I enable the web server to create a database?

I have installed Visual Studio 2005 Team Suite Beta 2, including SQL Server
2005 Express Edition April CTP, on Windows XP Professional SP2, including IIS
5.1. The SQL Server (SQLEXRPESS) service is running under the NT
AUTHORITY\NETWO RK SERVICE account. This machine is named VSDev01WSWP01.

I am also running SQL Server 2000 on a Windows Server 2003 computer named
VSDev01SQL02. This computer contains my application's database, which I have
integrated with the tables created by the aspnet_regsql tool.

Here are the first few lines of C:\Inetpub\wwwr oot\WebPortal\w eb.config,
which includes AspNetSqlProvid er:
<?xml version="1.0"?>
<configuratio n xmlns="http://schemas.microso ft.com/.NetConfigurati on/v2.0">
<connectionStri ngs>
<add name="SqlServic es"
connectionStrin g="Provider=SQL OLEDB;Server=VS Dev01SSQL02;Int egrated
Security=SSPI;D ata Source=Web Portal;Initial Catalog=WebPort al;" />
</connectionStrin gs>
<system.web>
<membership userIsOnlineTim eWindow="60">
<providers>
<add description="We b Portal" connectionStrin gName="SqlServi ces"
enablePasswordR etrieval="false " enablePasswordR eset="true"
requiresQuestio nAndAnswer="tru e"
passwordFormat= "Hashed" requiresUniqueE mail="false"
applicationName ="/"
name="AspNetSql Provider"
type="System.We b.Security.SqlM embershipProvid er" />
</providers>
</membership>

From Visual Studio 2005's Website menu, I selected ASP.NET Configuration,
then clicked the Provider Configuration link. I then selected "Select a
single provider for all site management data," then clicked the "Test" link
besider AspNetSqlProvid er. This produced the following error:

Server Error in '/asp.netwebadmin files' Application
--------------------------------------------------------------------------------
Failed to generate a user instance of SQL Server due to a failure in
starting the process for the user instance. The connection will be closed.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

SQLExpress database file auto-creation error:
....

The error message mentions the need for various forms of access to the
App_Data directory, so I granted Full Control to USERS, NETWORK SERVICE, and
ASPNET. I also made ASPNET a local administrator. I also verified that SQL
Server Express is installed and running.

Therefore, I have reached the conclusion that I need to grant the local
ASPNET account, which theoretically is being used by IIS, dbcreator
priviledge in SQL Server Express. However, this stripped-down product
contains no Enterprise Manager or Query Analyzer, so I do not know how to do
that. How can I grant that priviledge?
Nov 19 '05 #1
10 3806
Hi,

Thanks for posting here.
From your description, you've a XP sp2 box with Visual Studio 2005 Team
Suite Beta 2(alsoSQL Server
2005 Express Edition April CTP) installed. When you try to use the
SqlServer Provider for the ASP.NET web application ,here occurs some error
indicate that the sqlserver instance wasn't correctly established, yes?

As for the problem you described, one thing made me a bit confused was
you're configuring the Membership service to use the remote sqlserver
database on a 2003 server, but the error info said something incorrect with
the App_Data folder. Based on my local BETA2 testing, when I don't
explicitly configure a remote datasource for membership and configure to
use the SqlServer Provider, it'll automatically create the required db in
my local SQL Server 2005 Express Edition April CTP and the ASPNETDB.MDF
file will occur in the App_Data sub dir. What'll happen if you remove your
remote db configuration and try using the local SQL Server 2005 Express
Edition to perform as the membership provider? Will it also
throw such error?

In addition, you can also post the this issue to the new MSDN forum on the
web to see whether any other community members have encountered the
similiar problom.

http://forums.microsoft.com/msdn/

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #2
Yes, you seem to understand the problem.

I tried to do what you suggested in web.config:
1. In connectionStrin g, I changed the Server to VSDev01WSWP01 (the local XP
machine), then I removed the Server entry completely. Both times I received
the same error as before.
2. in the AspNetSqlProvid er provider, I commented out
"connectionStri ngName=SqlServi ces". This made it even worse. The error I
received was "Access is denied for the application you are attempting to
administer."

So, that leaves me back where I started.

However, I want to empathize that in the original problem, the error message
stated, "The web server account used to connect to SQL Server Express must
have rights to create a new database." Since I am running IIS 5.1, the
message stated that the default web server account is the local ASPNET
machine account. I want to try granting this account the dbcreator
priviledge, but I do not know how. SQL Server Express does not seem to come
with Enterprise Manager or Query Analyzer, so I do know how to enter a
command to grant that priviledge.

Furthermore, when I try to connect to SQL Server Express from VSDev01SSQL02
using either Enterprise Manager or Query Analyzer from SQL Server 2000, I
receive the message, "SQL Server does not exist or access denied." I am
logged in as a Domain Admin and using Windows authentication.
Nov 19 '05 #3
Thanks for your response and the further detailed description.

After my last message, I sudently realize that you created your ASP.NET 2.0
website through HTTP in IIS while I always use FileSystem. When using
FileSystem, the VS.NET 2005 use test webserver to run the web app / admin
app, and by default it use NTLM authentication , so the executing account
is the current logon user. However, when using Http sever(IIS), by default
the web application integrated windows authentication and allow anomymous
in IIS virtual dir. Then, we navigate to the web admin page, the current
executing context is the IIS's anomymous account. Since anomymous account
is a very restricted account, it hasn't the sufficient permissions to
create the sqldatabase. As far as my local tests, I got this behavior. So
I think you can try the following things:

1. Create a new web application through HTTP in IIS. And test SQLserver
provider in web admin page to see whether the error also occur.

2. If occur, check the IIS virtual dir's "directory security" setting to
see whether allow anonymous access is checked, if so uncheck it (make sure
integrated windows ) is used. Then, restart web admin page and retry.

3. Creating a new web application through File System to see whether we can
correctly test the ASPSqlProvider

#When perfom the above tests, don't add any custom configuration in
web.config since there have default confifured providers for membership or
other services in machine level config.

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #4
Thank you for your suggestions, but I was still unable to create the database.

Here is what I did:
1. Using Visual Studio 2005 Beta 2, I created an ASP.NET Web Site through
HTTP. I then selected ASP.NET Configuration from the Website menu, and
tested the AspNetSqlProvid er. I received the same error as before.

2. In IIS, I unchecked anonymous access in the virtual directory's
directory security and made sure that Integrated Windows authentication was
checked. I retested, but received the same error.

3. Using Visual Studio 2005 Beta 2, I created another ASP.NET Web Site
through the File System, but the AspNetSqlProvid er failed as before.

Nov 19 '05 #5
Although I have still had no success creating the database, here is what I
have tried over the weekend:

I tried some new connection strings in web.config. Here is the updated
file, showing everything I tried:
<?xml version="1.0"?>
<configuratio n xmlns="http://schemas.microso ft.com/.NetConfigurati on/v2.0">
<connectionStri ngs>
<add name="SqlServic es"
connectionStrin g="Provider=SQL OLEDB;Integrate d Security=SSPI;D ata
Source=VSDEV01S SQL02;Initial Catalog=WebPort al;" />
<add name="SqlServic esOLEDB"
connectionStrin g="Provider=SQL OLEDB;UID=devel oper;PWD=secret ;Data
Source=VSDEV01S SQL02;Initial Catalog=WebPort al;" />
<add name="SqlServic esODBC"
connectionStrin g="DSN=WebPorta l;Initial
Catalog=WebPort al;UID=develope r;PWD=secret;" />
</connectionStrin gs>
<system.web>
<membership userIsOnlineTim eWindow="60">
<providers>
<add
name="AspNetSql Provider"
type="System.We b.Security.SqlM embershipProvid er"
connectionStrin gName="SqlServi ces"
applicationName ="/WebPortal"
requiresUniqueE mail="false"
enablePasswordR etrieval="false "
enablePasswordR eset="true"
requiresQuestio nAndAnswer="tru e"
passwordFormat= "Hashed"
description="We b Portal"
/>
</providers>
</membership>

Also, I have discovered a very quick way to generate a more specific error
message that seems to be related to this problem:
1. From Visual Studio's Website menu, select ASP.NET Configuration.
2. Select the Security tab.
3. The following message appears:
"There is a problem with your selected data store. This can be caused by an
invalid server name or credentials, or by insufficient permission. It can
also be caused by the role manager feature not being enabled. Click the
button below to be redirected to a page where you can choose a new data
store.

The following message may help in diagnosing the problem: 'Unable to connect
to SQL Server database.'"

I have verified that the server name and credentials are correct by
connecting to the database from another workstation with Enterprise Manager.
I am logged in as a domain administrator, and the "developer" login that I
tried using SQL Server Authentication is a member of every role in the
database, including the aspnet roles. I am not using the ASP.NET 2.0 roles,
so I did not enable the "role manager feature," and I do not even know how to
do that.
Nov 19 '05 #6
Thanks for the further followup.

Really very strange.
As for enable the RoleManager you can just put the
<roleManager enabled="true" />
in your web.config though I remember that there is a certain check option
in the web admin page.

In addition, I didn't put any explicit declaration of the providers in my
web.config, I used the default configured in the machine.config. So My
web.config is like below:

=============== =============== =
......
<system.web>
<authorizatio n>
<allow roles="admins" />
<allow users="?" />
</authorization>
<roleManager enabled="true" />
<authenticati on mode="Forms" />
</system.web>
..............
=============== =============== =

Then, I'm able to create the ASPNETDB.MDF file under App_Data folder. Have
you also tried this?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #7
Although you did not directly solve my problem, today I was able to solve it
by studying the machine.config file that you mentioned (I did not even know
it existed before today).

Here is what I did. First, I commented out the "LocalSqlServer " connection
string in machine.config:
<connectionStri ngs>
<!-- <add name="LocalSqlS erver" connectionStrin g="data
source=.\SQLEXP RESS;Integrated
Security=SSPI;A ttachDBFilename =|DataDirectory |aspnetdb.mdf;U ser
Instance=true" providerName="S ystem.Data.SqlC lient" /> -->
</connectionStrin gs>

Second, I replaced it in web.config and added the new provider:
<?xml version="1.0" encoding="utf-8"?>
<configuratio n xmlns="http://schemas.microso ft.com/.NetConfigurati on/v2.0">
<connectionStri ngs>
<!-- The following line replaces the equivalent line in
C:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50215 \CONFIG\machine .config,
which has been commented out. Technically, VSDev01SSQL02 is not a local
SQL Server, but it works, as opposed to SQL Express, which does not. -->
<add name="LocalSqlS erver"
connectionStrin g="Integrated Security=SSPI;D ata
Source=VSDev01S SQL02;Initial Catalog=WebPort al;"
providerName="S ystem.Data.SqlC lient" />
<!-- This is an identical connection string, but given a new name
to emphasize that it will always be on a separate machine that
contains the application data. -->
<add name="SqlServic es"
connectionStrin g="Integrated Security=SSPI;D ata
Source=VSDev01S SQL02;Initial Catalog=WebPort al;"
providerName="S ystem.Data.SqlC lient" />
</connectionStrin gs>
<system.web>
<membership
defaultProvider ="SqlProvide r"
userIsOnlineTim eWindow="60">
<providers>
<add connectionStrin gName="SqlServi ces" applicationName ="/visual studio
2005"
requiresUniqueE mail="false" enablePasswordR etrieval="false "
enablePasswordR eset="true" requiresQuestio nAndAnswer="tru e"
passwordFormat= "Hashed" description="We b Portal" name="SqlProvid er"
type="System.We b.Security.SqlM embershipProvid er" />
</providers>
</membership>

Please note that one of the primary issues was that I was previously using
SQLOLEDB as my provider in the connection string, and that is what caused the
connection to fail. When I switched to the format in machine.config, as
shown above, I was able to connect to the database.

Thank you for your help.
Nov 19 '05 #8
Thanks for your followup.

I'm also very glad that you've overcome the problem.
Enjoy Whidbey ! :-)

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #9

I'm having the same problem getting SQLExpress to auto create m
database. I've been able to get the database created automatically o
several occations through the 2005 web admin site, but it seems to hav
just stopped working.

I get the following error:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Sit
Administration tool, use the aspnet_regsql command-line utility t
create and configure the database, and then return to this tool to se
the provider.

The Event Viewer has the following error:

Failed to generate a user instance of SQL Server due to a failure i
starting the process for the user instance. The connection will b
closed. [CLIENT: <local machine>]
I have default machine.config and web.config files, so I have change
nothing from the default installation of VS2005 Beta. In fact,
uninstalled everything and reinstalled everything and still have th
problem. Please help.

Derek Greer
FedEx Corporate Service

--
derekgree
-----------------------------------------------------------------------
derekgreer's Profile: http://www.highdots.com/forums/member.php?userid=25
View this thread: http://www.highdots.com/forums/showthread.php?t=76717

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2090
by: simpsoro | last post by:
How do you enable debugging so that people see it from the client side? I have gone in to properties, clicked on edit www service, clicked on the home directory tab, clicked on the configuration button, clicked on the app debugging tab and then checked the box that says enable ASP client-side script debugging. But on the client side they still get the generic debug message: -----------------------------------------------------------...
0
1253
by: CR | last post by:
To check out stored procs that are under VSS control via my client machine using .NET, I believe I need to change the Options - Database Tools - Server Explorer - STored Procedures - Enable Version Control from unselected to selected. Problem is that I can't select it. Our sql server is already setup for VSS/SourceSafe control, and other users are able to check out stored procs from it through the .Net IDE by checking the 'Enable Version...
1
2000
by: stevenkblack | last post by:
I want to have a script that checks that my databases are up and running. I just want the scrip to connect to several databases and check the count of a certain table. I want this script to run every 10 minutes. I know that every night I am taking the database down for backup and they won't be available and the script will fail. I have been looking into the systools tables to see what changes when you make enable/disable a script but...
6
7747
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. Because I don't want a post-back, I added some javascript to do this However, using client-side JS, I cannot enable any controls that have been disabled by server-side code. If the control is initially enabled, I can disable/enable it client-side.
1
2979
by: simpsoro | last post by:
How do you enable debugging so that people see it from the client side? I have gone in to properties, clicked on edit www service, clicked on the home directory tab, clicked on the configuration button, clicked on the app debugging tab and then checked the box that says enable ASP client-side script debugging. But on the client side they still get the generic debug message: ...
3
7249
by: James | last post by:
Hello, I am having a problem with a MS Access 2000 Database that I partially helped create. I am recording visits that registered customers make to our store. I have a list of all the elidgible people that can shop, and when I click a button, it records a visit for today in Date/Time format. My problem is that the button that records the visit can be clicked multiple times, and I am trying to find a way to lock it for a few seconds so...
1
2116
by: danyeungw | last post by:
I get the following from the link http://support.microsoft.com/kb/314206. I need to have both work - the page stays where it is and set focus to next control. Does anyone have solution? I have been working on this for days. I am using ASP.NET 2003. Thanks. DanYeung PRB: Controls Lose Focus When You Enable SmartNavigation and AutoPostBack View products that this article applies to. Article ID : 314206 Last Review : February 23,...
10
6115
by: =?Utf-8?B?UHVuaXQgS2F1cg==?= | last post by:
Hi, I am developing a windows application in VS.NET 2005. The application is database driven and I need to deploy it on a client's pc. How should I go about developing such an application. I remember I did something once long back .. like including .mdf files into my project in the solution explorer of VS 2005 and then used Click Once deployment tool ... to make sure that the database and tables were created when the client installed my...
3
11670
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm very new to VBA,i tried to follow the instructions reported in the code,but i got no result,i still can use the shift key,can you explain in details how to use it correctly to enable/disable users from pressing shift key to view database windw?,the...
0
11089
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10713
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10809
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9550
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5777
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4595
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4192
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3219
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.