Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 7th, 2003, 01:16 AM
Registered User
 
Join Date: Oct 2003
Location: Hyderabad, AP, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access DB Connection (Jet cannot Open)

i'm trying to connect an Ms-Access DB on network thru my asp page.
That database is opened by other application in sharemode.

When I try to open a connection thru my asp page it's displaying the following message

Error Type:
Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the file '\\server\e\database\Job Manager.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
/

Here is my code:
pt="\\server\e\database\Job Manager.mdb"
set objconn=createobject("adodb.connection")
ObjConn.ConnectionString="Provider=Microsoft.Jet.O LEDB.4.0;Data Source=" & pt & ";Persist Security Info=False"
objconn.Mode=admodesharedenynone
ObjConn.Open

Anybody please help me

M.L.Srinivas

Reply With Quote
  #2 (permalink)  
Old October 7th, 2003, 03:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

My guess would be a permissions problem. What user is your asp page running under? Is it the "anonymous" user IUSR_MachineName? What version of Windows and IIS is your webserver?
Reply With Quote
  #3 (permalink)  
Old October 7th, 2003, 06:04 AM
Registered User
 
Join Date: Oct 2003
Location: Hyderabad, AP, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply,

i'm quiet new to ASP. These are my system details.
It's Win2000 server with IIS 5.0.

I'm using administrator user to login to the server and i have no idea about ISUR_machinename and about anonymous user, can pls let me know?

Please and thanks for your reply
M.L.Srinivas


Reply With Quote
  #4 (permalink)  
Old October 7th, 2003, 06:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

OK, you need to check whether the ASP page(s) are running under the anonymous user, because the account of the user is key to sorting out this problem - assuming its a permissions problem (but we can't check that for sure until we know which user is running the page).

As you're new to ASP here's a bit of background about users and IIS:
When a windows machine runs as a webserver then, in principle, users can connect to it across the internet from any machine (Windows, Unix, Mac etc) and request files (HTML, ASP, GIF etc). Now, Windows controls all access to files (and a lot of other resources) via user accounts and Access Control Lists, but internet users have no user accounts as far as the windows webserver is concerned, so how is it to solve this dilemma? The answer is the anonymous user account, which is created as a local account on the windows webserver, and is generally called IUSR_<<MachineName>>. By default, all requests to files from internet users (including asp files) are processed under this anonymous user account, and are granted or denied access to the files they requested according to the permissions of this anonymous user. OK?

Now, back to business :)
To check what user account your asp files are running under, do this on your Win2000 server:
1. click Start > Programs > Administrative Tools > Internet Services Manager. This will bring up MMC with the IIS snap-in.
2. Locate the root of your website in the treeview in the left pane (it will either be Default Web Site with a globe icon, or <<YourAppName>> underneath that with an icon that looks like an open grey box with a green ball inside!), right-click on it and choose Properties from the pop-up menu. You should now see a tabbed dialog box.
3. click on the Directory Security tab
4. click the Edit button at the top of the tab (in the box with the handshake graphic) and this will bring up another dialog box
5. See if the "anonymous access" checkbox is ticked.
6. If its not ticked, tell me what other checkboxes on that page are ticked.
7. If it is ticked, click the Edit button in the anonymous access box - this brings up the final dialog box. Finally, tell me what it says in the Username box on that final dialog.

Phew! Once we know what the username is we can proceed from there. OK?

rgds
Phil
Reply With Quote
  #5 (permalink)  
Old October 8th, 2003, 12:02 AM
Registered User
 
Join Date: Oct 2003
Location: Hyderabad, AP, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mr. Phil,

Thanks for your time.

My website is running under anonymous user only. And as you had expected the problem is with permissions only.

Coz, I tried with the database copied locally and it was working fine with that setting.

And for further information, as I have already mentioned database is on another system, which is a NT Server 4.0. But most important thing in this scenario is Webserver and Database Server are in seperate domains and in the same work group, I believe this is the cause for this problem.

As you are already doing, pls suggest me a way out.

Thanks
M.L.Srinivas

Reply With Quote
  #6 (permalink)  
Old October 8th, 2003, 03:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

OK its the anonymous user, so what we need to do is allow that user to read/write the database. The problem is that the anonymous user is a local account on the webserver - other servers on the network know nothing about this user.

The solution is to create a local account on the NT server where the database resides with the same name and (this is very important) the same password as the anonymous user, then give that user read/write privileges to the share where the database is located. Are you able to do that?

If you don't know the password of the anonymous user, then you must change it before you create the local account on the database server. The change must be made in 2 places: in the User Manager on the webserver*, then in Internet Services Manager on the webserver (I'm talking here about the final dialog in step 7 of my last post).

*you can get to User Manager by Start > Programs > Administrative Tools > Computer Management. Then in the left-hand pane click on System Tools > Local Users and Groups > Users. Then in the right-hand pane you should see the user IUSR_<<machineName>>, right-click the user and choose Set Password from the pop-up menu.

An alternative is to change the anonymous user to a network account that already has privileges to read/write the database - but since they are on different domains this will probably not help you, unless there is a trust set up between the domains.

hth
Phil
Reply With Quote
  #7 (permalink)  
Old October 8th, 2003, 08:08 AM
Registered User
 
Join Date: Oct 2003
Location: Hyderabad, AP, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mr. Phil,

Thanks a lot. Your suggestion worked for me. Thanks for your time and suggestion.


M.L.Srinivas


Reply With Quote
  #8 (permalink)  
Old October 8th, 2003, 08:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I like happy endings :D. Glad to help.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I open access DB stored in CD from VB Andraw Pro VB Databases 1 August 14th, 2008 10:05 AM
Find open DB Connection again Ron Howerton ASP.NET 2.0 Professional 0 April 23rd, 2008 10:29 AM
Access (.mdb) over network using Jet 4 OLE DB sajid_rauf Pro VB Databases 0 May 16th, 2007 07:41 AM
open access db from read only media (eg. CD) albertos ADO.NET 0 August 27th, 2005 06:54 PM
Need HELP, MS access DB, Jet OLEDB, asp Caley L. Baumgart Classic ASP Databases 7 March 23rd, 2004 11:53 AM



All times are GMT -4. The time now is 08:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.