By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 738 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

Problems accessing an MS Access 2000 DB in ASP

P: n/a
Our graphic designer is developing our new company website. We have switched
providers and currently she is working on the new website which currently
ressides on the new providers server as they support the ASP development
environment. Their server is a Win2K3 server.

She is writing an ASP module to connect to an MS Access 2000 database and is
having problems connecting. In this database there is only one table.

She has tried many different connection strings all to no avail and then
found from investigating that the best and fastest method is to use the OLE
connection string. However, each time she runs the ASP code she gets the
following error...

----------------------------------------------------------------------------
--------
Microsoft JET Database Engine error '80004005'

You do not have the necessary permissions to use the
'E:\Files\LocalUser\truenorth\NewFiles\models.mdb' object. Have your system
administrator or the person who created this object establish the
appropriate permissions for you.

/NewFiles/db_simple2.asp, line 14
----------------------------------------------------------------------------
--------

We have asked the provider to make sure that the NTFS file privs have been
set appropriately on the directory this db is in, and they have informed us
that it has been. I use Access here at work, and I can generate this error,
if I have forgotten to give a user "open/run" rights on the actual
database - using the 'Security' settings. But, we use a workgroup
information file (.mdw) file here at work. Typically if you do not specify
the workgroup file the default user of admin is used - which has full access
to the DB. However, if our provider does not have Access installed on their
server - which they likely do not, then there would be no default system.mdw
file - and then how would you connect to the db and get any privs at all?
Does anyone have any clue what might be happening here? Do we need to
specify a system file in the db connection string and also specify a
username/password to connect with? And, if so, does anyone have the proper
syntax for doing so?

The ASP code she is using is shown below...

----------------------------------------------------------------------------
-----
Dim cnnDB ' ADO connection
Dim rstDB ' ADO recordset
Dim strDBPath ' path to Access database (*.mdb) file
Set cnnDB = Server.CreateObject("ADODB.Connection")
Set rstDB = Server.CreateObject("ADODB.Recordset")

' path to Access 2000 database on Internet providers server
strDBPath = Server.MapPath
("E:\Files\LocalUser\truenorth\NewFiles\database\m odels.mdb")

cnnDB.Open "Data Source=" & strDBPath & ";Provider=Microsoft.Jet.OLEDB.4.0;"

Set rstDB = cnnDB.Execute("SELECT * FROM models")

Do While Not rstDB.EOF
rstSearch.Fields("modelfolder")
rstSearch.Fields("modeltotal")
rstSearch.Fields("modeltype")

rstDB.MoveNext

Loop

rstDb.Close

Set rstDB = Nothing

cnnDB.Close

Set cnnDB = Nothing
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Brad Pears wrote:
Our graphic designer is developing our new company website. We have
switched providers and currently she is working on the new website
which currently ressides on the new providers server as they support
the ASP development environment. Their server is a Win2K3 server.

She is writing an ASP module to connect to an MS Access 2000 database
and is having problems connecting. In this database there is only one
table.

She has tried many different connection strings all to no avail and
then found from investigating that the best and fastest method is to
use the OLE connection string. However, each time she runs the ASP
code she gets the following error...

-------------------------------------------------------------------------- -- --------
Microsoft JET Database Engine error '80004005'

You do not have the necessary permissions to use the
'E:\Files\LocalUser\truenorth\NewFiles\models.mdb' object. Have your
system administrator or the person who created this object establish
the appropriate permissions for you.

/NewFiles/db_simple2.asp, line 14
-------------------------------------------------------------------------- -- --------

We have asked the provider to make sure that the NTFS file privs have
been set appropriately on the directory this db is in, and they have
informed us that it has been.


The IUSR_machinename account needs read/write permissions on the folder
containing the database file. If you are connecting in a Session or
Application event, or the application protection is set to high, then the
IWAM_machinename account also needs those permissions.

The person setting up the security for your database can verify that the
appropriate permissions are set by logging into the machine using the IUSR
account and verifying that he can create and delete a text file in the
database folder.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.