Problems accessing an MS Access 2000 DB in ASP

B

Brad Pears

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\models.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
 
B

Bob Barrows [MVP]

Brad said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top