Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP 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
 
Old October 11th, 2003, 07:56 AM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Begginer Asp difficulty connecting to acces databa

Hello

I am using Visual studio. net application to create my asp file.


These are the errors i am constantly getting!!!

The Microsoft Jet database engine cannot open the file 'C:\database\Northwind.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

Line 194: Private Sub Page_Load(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles MyBase.Load

Line 196: OleDbDataAdapter1.Fill(DataSet1)this line is highlighted by my debugger

Line 197: DataGrid1.DataSource = DataSet1
Line 198: DataGrid1.DataBind()
I used the wizard to create my connection and set my sql statement!


When i open my server explore it tells me that i am connected
to the database and from the server explore i can edit and save any changes that i have made.
I was wondering do i have to have mdb file in a particular folder?
Example like the bin or root directory.

I don't have access so i just download the mdb file from wroxs.
Whats curious is i am able to make a connection when i just use a text editor like notepad.
 
Old October 11th, 2003, 09:26 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I think this is a classic ASP forum, so you may try your luck in one of the .NET forums for similar problems in the future.

Anyway, the problem is related to permissions. When you connect to the database using the Server Explorer (I assume you're using Visual Studio .NET?) you connect under your user account which apparently has enough permissions.

At run-time, however, the web server connects to this database. The account that the web server uses is usually IUSR_MachineName where MachineName is the name of your computer. This account needs enough permissions for both the .mdb file and the folder it resides in.

To change the permissions, open a Windows Explorer, right-click C:\database, choose Properties and then on the Security tab add the IUSR_MachineName account. Make sure it has at least read and change permissions.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 5th, 2004, 02:53 PM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!
I also had this problem when using Dreamweaver MX, and as you say, no bother with Notepad editting & viewing in a browser, or on a remote platform.
I'm not too hot on the .Net stuff yet but certain wysiwyg environments keep hold of the connection they create whilst setting up the initial environment and whilst working with it ( if that makes sense)

Try looking in your folder where you're storing your .mdb file, if there's also a .ldb file with the same prefix, right click and send to notepad, you'll probably see that the database is opened by admin..
Save your work, close the software environment down and delete the .ldb file then try again...
Might work
:)

Simon

Don't think, do!





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.net ASPNET user account and SQL Server databa cJeffreywang ASP.NET 1.0 and 1.1 Basics 0 March 27th, 2007 08:25 PM
visual c++ begginer.. want help anoria BOOK: Beginning Visual C++ 6 1 December 31st, 2005 02:49 PM
Problems in ASP.NET 2 when I update my ODBC databa Armando Barbarin Rionda ASP.NET 1.0 and 1.1 Professional 1 July 1st, 2005 01:20 AM
Problems in ASP.NET 2 when I update my ODBC databa Armando Barbarin Rionda ASP.NET 1.0 and 1.1 Professional 0 June 30th, 2005 05:07 PM
ASP CDO.Message difficulty crmpicco Classic ASP Basics 0 March 1st, 2005 07:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.