 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 17th, 2003, 02:52 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Converting form SQLClient to OleDb
Hi,
Can anyone think of a reason why I would be getting a "Operation must use an updateable query" error when trying to update Northwind.mdb using 'adapter.Update(customerDataset)'. I used the OleDbCommandBuilder.
The the exact same command works perfectly using the SQLClient namespace against the SQL Server version of the Northwind database. I used the SQLClientCommandBuilder.
All I did was change the SQLClient to OLEDB and the path to the database. Hmmmmm.....
Thanks,
Bob
|
|

July 17th, 2003, 03:32 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Your ASPNET account has not write permission on Northwind.mdb
...but the Soon is eclipsed by the Moon
|
|

July 17th, 2003, 04:11 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
But...
Northwind is unsecured:
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Inetpub\wwwroot\OleDbWebSite\Northwind.m db;" & _
"User ID=Admin;" & _
"Password="
The connection string is in Global.asax
Is there somewhere else I should be looking? In the IIS virtual directory maybe? Kinda' new to web databases...
Thanks for the reply,
Bob
|
|

July 17th, 2003, 04:33 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
I'm working with the project from the Wrox Book "Beginning Visual Basic .NET Databases". Chapter 11 is called "ASP.NET". The download project works fine in SQL Server. I'm just trying to get it to run off the Northwind.mdb database. I barely had to change the code at all. I just changed "SQL" to "OleDb" in about 4 places and put a copy of the Northwind.mdb in www\inetpub\OleDbWebSite\Northwind.mdb............ ....Im running everything locally...thought that would do it...
|
|

July 17th, 2003, 04:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Put this:
Code:
Response.Write (User.Identity.Name.ToString());
in order to find user account, and then grant write permission on Northwind.mdb to this account.
If yoour ASPX page run under IIS anonymous account, then u can disable anonymous access on IIS settings or grant mentioned permission to this account.
...but the Soon is eclipsed by the Moon
|
|

July 17th, 2003, 04:45 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
The database may be unsecured, but the ASP.NET account needs write permissions to the database and the folder it resides in on the NTFS level.
So, make sure that the right security permissions for this account are set under Windows security.
HtH
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 17th, 2003, 11:46 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Thanks guys,
I got a writable dataset by disabling anonymous access, enabling Windows authentication, and adding <identity impersonate="true"/> to the Web.config file. Guess I'm impersonating my own administrator log on.
I noticed the aspnet_wp account under User Accounts. Is that what you are referring to as the ASPNET account? Maybe I should just assign administrator priviledges to that account, huh?
Oh, I stole this from another Wrox book, but its an easy VB.NET way to view the user account:
Imports System.Security.Principal
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Write(WindowsIdentity.GetCurrent().Name)
End Sub
|
|

July 18th, 2003, 08:25 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Bob,
By default aspx page is processed under IUSR_machine_name account if IIS anonymous access is enabled, or LOCAL SYSTEM account (ASPNET - you saw under accounts) if it's disabled.
If the impersonation is enabled then the process willbe executed under appropriate Windows logon account.
You can, however, configure Web application to execute under specified account by adding this line in Web.config file:
<identity impersonate="true" userName="BobsComp\Bob" password="pass" />
You should be aware that this account needs to have RW permissions to the directory "Temporary ASP.NET files".
...but the Soon is eclipsed by the Moon
|
|

July 18th, 2003, 09:39 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Thanks Milos,
I think I'm getting it a little. How was the ASPNET (aspnet_wp) user account created, by the .NET Framework install?
Bob
|
|

July 18th, 2003, 01:28 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
|
|
Hi all,
For future reference, the following KB articles are good references for this issue:
316675 - PRB: Cannot Connect to Access Database from ASP.NET
315736 - HOW TO: Secure an ASP.NET Application by Using Windows Security
Thanks again,
Bob
|
|
 |