Solved

database opened exclusively by another user, or you need permission to view its data

Posted on 2006-06-15
20
275 Views
Last Modified: 2012-05-05
I have a domain  xxx.co.uk

On the same server I have a domain sslxxx.co.uk

xxx.co.uk has a database which is working OK on my local pc and remote server.

I want to run some of the files of xxx.co.uk on the sslxxx.co.uk

When the pages from sslxxx.co.uk try to use the database connection I get an error message.

The Microsoft Jet database engine cannot open the file 'D:\home\Default\xxx.co.ukxxx2002.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
It seems I have the connection correct but that permissions may be wrong.
In database properties Security is set to Internet Guest Account (machineName) full control
Can anyone see where I am going wrong please
Thanks
John
0
Comment
Question by:johnhardy
  • 8
  • 8
  • 3
  • +1
20 Comments
 
LVL 13

Expert Comment

by:prashsax
ID: 16914024
I think the problem is that the Database is being used by xxx.co.uk website already.

And then if you try and create a connection to it again, it gives you an error.

If you are using database directly, try to make connection using DSN.

I think, this will let you open the database from both the site simultaneously.

0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16914230
Your DB may be in single user mode (default for DBs created using MS Access) with each web site being treated as a single user.  You can test this by stopping the web site that can currently access the DB the restarting the DB that cannot currently access it and trying again.  If successful you will need to change your DB to multi-user mode.  How you do this will depend on what type DB this is (Access or some other) and if you can change the data access methods of these web apps.
0
 

Author Comment

by:johnhardy
ID: 16914432
Thanks
The database is Access 2003, can you say how this can be changed into multi user mode, I thought this was standard?
0
 
LVL 13

Expert Comment

by:prashsax
ID: 16914469
What kind of lock are you using in the connection statement.

You must use optimistic lock and no other lock option.
0
 

Author Comment

by:johnhardy
ID: 16914511
I cannot see anything about a lock in the code

MM_connUltraCartIIVB_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\home\Default\xxx.co.uk\htdocs\_hide\xxx.mdb;"
0
 
LVL 13

Expert Comment

by:prashsax
ID: 16914604
It should be in the recordset statement.

rst_name.Open str_source, str_connection, int_cursortype, int_locktype, lng_options

I am talking about int_locktype here.
0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16916510
1.  Open the DB in Access
2.  Go to Tools > Options > Advanced
3.  Set Default open mode to "Shared"
4.  Set Default locking to "No locks"
5.  Save, exit, restart both web apps, and retry

prashsax and johnhardy are talking about how the application handles concurrency (multiple edits to a single record at the same time) with record level locks (or lack thereof).  Your problem is that your working web app has opened the DB with exclusive access (aka single user mode).  Most applications will use the default open mode of the DB so a simple change from "Exclusive" to "Shared" should correct the problem.  Most applications also implement their own methods for handling concurrency so we can set this to "No locks" on the DB and save resources.

If this does not work it is possible that the open mode is coded into your web app.  We can address how to fix that if it comes up.

0
 

Author Comment

by:johnhardy
ID: 16916592
Thanks very much for the explanation
When I checked the settings in the dbase they were as prescribed. Pity!
0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16916723
Looks like it's coded into the app or dsn.  Can you track down the connection string in the code?  May look something like this:

"Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\App1\Your_Database_Name.mdb; Exclusive=1; Uid=Your_Username; Pwd=Your_Password;"

or

"Provider=MS Remote; Remote Server=http://Your-Remote-Server-IP; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb"

or

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Server_Name\Share_Name\Share_Path\Your_Database_Name.mdb"

or

"ODBC;DSN=MyDSN"

or

"ODBC;FILEDSN=c:\Program Files\Common Files\ODBC\Data Sources\MyDSN.dsn"

Once you have that we should be able to start tracking it down.
0
 

Author Comment

by:johnhardy
ID: 16916738
I now have two domains on my local server.
One to simulate the main site and one to simulate the ssl part
I am using dsn and on the local machine they can both see the same dsn connection

These two local domains apear to work correctly.

If I route to the ssl remote server, the database shows an error.

On the remote server I can make a connection from the main site to the dsn, but that dsn name does not show in the ssl domain.

This is because the dsn creation seems only to see paths within that domain rather than globally as the local server sees.

It seems to suggest that dsn cannot be used as it cannot be seen by both domains on the remote server.

Perhaps I should retry with the oledb method again?

The connection string at the moment is
Dim MM_connUltraCartIIVB_STRING
MM_connUltraCartIIVB_STRING = "dsn=xxxx;"

Thanks for all the help
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Expert Comment

by:CharliePete00
ID: 16916777
Try going dsnless or with a file based dsn:

for ODBC connection string

"Driver= {MicrosoftAccessDriver(*.mdb)};DBQ=C:\App1\Your_Database_Name.mdb;Uid=Your_Username;Pwd=Your_Password;"

OLEDB connection string

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Server_Name\Share_Name\Share_Path\Your_Database_Name.mdb"


0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16916795
Or go back to:

MM_connUltraCartIIVB_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\home\Default\xxx.co.uk\htdocs\_hide\xxx.mdb;;Mode=Share Deny None;"

Adding Mode=Share Deny None


0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16916820
One these days I'll actually learn to read.  It should look like this:


MM_connUltraCartIIVB_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Server\share\home\Default\xxx.co.uk\htdocs\_hide\xxx.mdb;;Mode=Share Deny None;"

Adding Mode=Share Deny None
Changing D:\ to \\Server\share\
0
 

Author Comment

by:johnhardy
ID: 16918272
Thanks
I notice on the remote main site if I use
Source=D:\home\Default\ ... the connection works OK

If I use Source=\\Server\share\ it fails with the error

Microsoft OLE DB Service Components error '80040e73'
Format of the initialization string does not conform to the OLE DB specification.

Should the word "Server" be replaced with a server name, if so where will I find that please?
0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16918769
Yes -

Server = the computername of the machine the DB file is located on
Share = share name of the shared folder the DB file is located on


for example

I Let's say I have an Access DB named Sales.mdb on a computer called Mickey.  The path to the DB file from that computer is D:\Databases\Financial\Sales.mdb but if I want to connect to that database accross the network I will need a file share.  I share out D:\Databases\Financial as Sales.  The path to the DB file from a remote computer would be \\Mickey\Sales\Sales.mdb where Mickey is the computername of the server and Sales is the name of the share.

I hope this makes sense.  If not we'll continue after I've had some sleep.
0
 
LVL 14

Expert Comment

by:FriarTuk
ID: 16918911
0
 

Author Comment

by:johnhardy
ID: 16919941
I hope you slept well if have done some more tests but so far I cannot get the connection.

I have tried as follows

In IIS IUSR_XXXX-WEB-RAW is the name of the general heading Web Sites

Connection used
MM_connUltraCartIIVB_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\IUSR_XXXX-WEB-RAW\share\SmylXXXX.mdb;;Mode=Share Deny None;"
When this is used as the connection on the ssl site it produces and error of:

Microsoft JET Database Engine error '80004005'
'\\IUSR_XXXX-WEB-RAW\share\SmylXXXX.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
=======================================

In IIS smylYYYY is the username of the main site smylYYYY (not the secure site, ie its username under IIS>web sites.)
Connection used
MM_connUltraCartIIVB_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\smylYYYY\share\SmylYYYY.mdb;;Mode=Share Deny None;"

This gives an error of
Microsoft JET Database Engine error '80004005'
'\\smylYYYY\share\SmylYYYY.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
======================================
Hope this is clear
Thanks for all the help
0
 
LVL 7

Accepted Solution

by:
CharliePete00 earned 500 total points
ID: 16924277
Server should be the name of the computer that the DB resides on.  To get the computer name:

From the machine the DB file is on:

1.  Right-click "My Computer" and choose properties
2. Go to the "Computer Name" tab
3. The computer name is listed next to "Full computer name:"
4. Go to the parent folder of the folder the DB file is in ("D:\home\Default\xxx.co.uk\htdocs\" I think)
5. Right-click the folder the DB file is in ("_hide") and choose properties
6. Go to the "Sharing" tab
7. Make sure "Share this computer on the network" or something similar is selected and copy the entry for "Share name"

Now your connectio string should look something like this:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Server\share\home\Default\xxx.co.uk\htdocs\_hide\xxx.mdb;;Mode=Share Deny None;"

Replacing Server with the info from step 2 and Share with the info from step 7
0
 

Author Comment

by:johnhardy
ID: 16926398
Thank you very much for such a very clear explanation.

I have carried out this method but still cannot make the connection. However with some luck I have a friend who may be able to see where I am going wrong and I will come back soon.
Regards
John
0
 

Author Comment

by:johnhardy
ID: 16929747
I found that there was a permission required on the site server which was missing. Thanks again for the great assistance
Regards
John
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now