|
 |
asp_database_setup thread: Unable to get ASP script to accept an Access 2000 file
Message #1 by "Peter Ferber" <peterfrb2@y...> on Mon, 12 Nov 2001 06:53:55
|
|
Hello. I am using the book "Beginning ASP Databases" by John Kauffman,
and I took the liberty of downloading all of the files associated with
this book. When I then ran the test page on page 75, the program worked
perfectly when using the database that was provided with the book. I had
the DSN called Sailors which pointed to the downloaded file. However, the
Access file was likely a '98 version; and what I have is Access 2000.
When I opened up the file, I had to upgrade the file to Access 2000, and I
called it Sailors_2000. I then updated the System DSN to point to
Sailors_2000, and I received the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database
engine cannot open the file '(unknown)'. It is already opened exclusively
by another user, or you need permission to view its data.
I'm pretty sure that this is a bug because I don't have Sailors_2000 open
when I run the ASP script; and the file, like its '98 counterpart, has no
restrictions on the table nor any on the file. If anyone has encountered
this and found a resolution, I'd sure like to know about it.
Sincerely,
Peter Ferber
Message #2 by "Peter Ferber" <peterfrb2@y...> on Mon, 12 Nov 2001 20:07:25
|
|
P.S.
For those unfamiliar with John Kauffman's book, this is the very useful
script from page 75 that verifies separately whether the HTML and ASP
portions of the code are working. Again, when the DSN references the
Access '98 file, everything works fine; and when it references the '2000
version, nothing works and I get the error.
<%@Language=VBScript%>
<html>
<head>
<title>Home Page</title>
</head>
<body>
<p>This line from HTML</p>
<hr>
<p>Next line from ASP will work<br>
if ASP extensions installed correctly:<br>
<%
response.write "<b>From ASP</b>"
%>
<hr>
<p>Next line from ADO will work if a DSN named sailors has been set<br>
for the database which is named SAILORS.MDB [but not SAILORS_2000.MDB].</p>
<%
set oRS=server.createobject("ADODB.recordset")
oRS.open "Select * from People", "DSN=sailors"
oRS.movefirst
response.write "<b>" & oRS("PeopleNameLast") & "</b>"
%>
<hr>
Finished test page</p>
</body>
</html>
Message #3 by "Ken Schaefer" <ken@a...> on Tue, 13 Nov 2001 11:59:33 +1100
|
|
Peter,
There is no Access 98 that I'm aware of.
Secondly, do you have the necessary ODBC drivers/OLEDB Providers installed?
You might want to download the latest Jet service pack release from:
http://www.microsoft.com/data/download.htm
Install MDAC v2.6 (if you don't have that already), then scroll down till
you see Jet SP3, and install that as well. Then create the DSN again.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Peter Ferber" <peterfrb2@y...>
Subject: [asp_database_setup] Re: Unable to get ASP script to accept an
Access 2000 file
: P.S.
:
: For those unfamiliar with John Kauffman's book, this is the very useful
: script from page 75 that verifies separately whether the HTML and ASP
: portions of the code are working. Again, when the DSN references the
: Access '98 file, everything works fine; and when it references the '2000
: version, nothing works and I get the error.
:
: <%@Language=VBScript%>
: <html>
: <head>
: <title>Home Page</title>
: </head>
: <body>
: <p>This line from HTML</p>
: <hr>
: <p>Next line from ASP will work<br>
: if ASP extensions installed correctly:<br>
: <%
: response.write "<b>From ASP</b>"
: %>
: <hr>
: <p>Next line from ADO will work if a DSN named sailors has been set<br>
: for the database which is named SAILORS.MDB [but not
SAILORS_2000.MDB].</p>
: <%
: set oRS=server.createobject("ADODB.recordset")
: oRS.open "Select * from People", "DSN=sailors"
: oRS.movefirst
: response.write "<b>" & oRS("PeopleNameLast") & "</b>"
: %>
: <hr>
: Finished test page</p>
: </body>
: </html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "Peter Ferber" <peterfrb2@y...> on Tue, 13 Nov 2001 05:24:15
|
|
Hello, Ken, and thank you for your prompt reply.
I had already downloaded the latest version of mdac; and, on your
suggestion, I downloaded the jet pack. I ran the program
(jet40sp3_comp.exe); but, in spite of this, no items were added to my list
of ODBC choices. The program, after copying files to my hard drive,
simply stopped but did not confirm anything nor request that I restart my
computer. I restarted my computer anyway, but still there were no new
choices added.
On the list where I select an ODBC driver, the following is the
configuration for Access:
Name: Microsoft Access Driver
Version: 4.00.6019.00
File: ODBCJT32.DLL
Date: 5/8/2001.
Let's continue this conversation. And here's an important question: have
you ever successfully run an ASP script off of an Access '2000 file?
Kind regards,
Peter
Message #5 by "Peter Ferber" <peterfrb2@y...> on Tue, 13 Nov 2001 05:48:50
|
|
Ken:
I reread your message and, thinking I misunderstood the first time
through, tried a new tack. I decided to delete my old DSN and create a
new one with the same parameters as before. This time, I got a new error,
which actually shows progress:
Microsoft JET Database Engine (0x80004005)
The Microsoft Jet database engine cannot open the
file 'C:\...\Sailors_2000.mdb'. It is already opened exclusively by
another user, or you need permission to view its data.
At least it's recognizing the file, but the message is still befuddling.
I didn't have an Access session running when I received the error nor can
I tell that there any restriction on the file or tables. All of the
tables have a complete set of permissions; no password is placed on the
file; and the file is not read-only.
It is progress, though,
Peter
Message #6 by "Peter Ferber" <peterfrb2@y...> on Tue, 13 Nov 2001 06:21:37
|
|
Sorry, I goofed.
I had changed my ASP script which is why I thought I was making progress.
The problem with the '2000 version is still in effect. But here's a bit
of sunshine in the gloom. Under Tools/Database Utilities/Convert
Database/To Prior Access Database Version, I created a new file,
Sailors_Converted. I pointed the DSN to this file; and, again, the ASP
script worked perfectly.
The problem is now squarely with Access '2000, verified with repeated
empirical observation. And, Ken, my question still stands.
Over and out,
Peter
Message #7 by "Ken Schaefer" <ken@a...> on Wed, 14 Nov 2001 11:01:42 +1100
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Peter Ferber" <peterfrb2@y...>
:
: Let's continue this conversation. And here's an important question: have
: you ever successfully run an ASP script off of an Access '2000 file?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Many times...
Cheers
Ken
Message #8 by "Ken Schaefer" <ken@a...> on Wed, 14 Nov 2001 11:06:17 +1100
|
|
OK,
Let's try something else.
Firstly, in the Access .mdb make sure that you are opening the database in
"shared mode", not "exclusive mode" - You can set this under "Tools |
Advanced | Default Open Mode"
Secondly, let's try to see of the ODBC drivers are at fault. Instead of
using ODBC, let's use the native OLEBD Provider instead. Your connection
string should look like this in your ASP page:
<%
strConnect = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\databases\db1.mdb"
' Obviously you change the path to be the path to your
' database that you have!!
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
%>
If you still get an error, can you please post it? (OLEDB raises different
error messages to ODBC, so we might be able to get a better idea).
Lastly, if you're only a WinNT/2k/XP machine, ensure that the anonymous
internet user account (IUSR_machinename) has sufficient privileges to the
file and the folder that the file is in (to create and destroy the .ldb
lockfile).
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Peter Ferber" <peterfrb2@y...>
To: "ASP Database Setup" <asp_database_setup@p...>
Sent: Tuesday, November 13, 2001 6:21 AM
Subject: [asp_database_setup] Re: Unable to get ASP script to accept an
Access 2000 file
: Sorry, I goofed.
:
: I had changed my ASP script which is why I thought I was making progress.
: The problem with the '2000 version is still in effect. But here's a bit
: of sunshine in the gloom. Under Tools/Database Utilities/Convert
: Database/To Prior Access Database Version, I created a new file,
: Sailors_Converted. I pointed the DSN to this file; and, again, the ASP
: script worked perfectly.
:
: The problem is now squarely with Access '2000, verified with repeated
: empirical observation. And, Ken, my question still stands.
:
: Over and out,
: Peter
Message #9 by "Peter Ferber" <peterfrb2@y...> on Wed, 14 Nov 2001 02:04:58
|
|
Thanks, Ken. I actually did get it to work. I finally created a new
database, imported the tables into it, and pointed the DSN to the newly
created ('2000) file.
Thank you for the suggestions anyway. If I'm feeling intellectually
curious, I will try what you suggest on the errant file: the knowledge may
prove useful down the road. I won't spend too much time on it, however,
as I've already "been there" and "done that" with the obsessive-compulsive
thing :-) . . . and the file may simply be corrupt.
Cheerfully,
Peter
|
|
 |