473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP Classic: Problems when trying to connect to a database.

Hi, I am currently trying to get back into ASP and have begun looking at an
old webpage I developed some years ago, it was fully functional back in 2002
and I had it up and running with no problems. I have just recently bought a
new PC with Windows Vista Home Premium on it and installed IIS. When I try
and connect to my data base I get the following error message retunred:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Disk or network error.

/joynermorgan/take_registration.asp, line 50
Line 50 looks like this:

writeDB.Open "joynerm"

joynerm is the system DSN that I created to connect to my database.

The following is the actual code from the file take_registration.asp where
the error is occuring:

<%
if p_password1 = p_password2 then

set writeDB = Server.CreateObject ("ADODB.Connection")
writeDB.Open "joynerm"

sqlText = "select * from members where username = '"& p_username &"'"
set userSet = DataBase.Execute (sqlText)

if userSet.EOF then

userSet.Close
set userSet = Nothing

theSQL = "insert into members"
theSQL = theSQL & " (username, pass, first_name, last_name, email) "
theSQL = theSQL & "values '"&p_username&"', '"&p_password1&"',
'"&p_firstname&"', '"&p_lastname&"', '"&p_email&"')"

end if

DataBase.Execute (theSQL)

DataBase.Close
set DataBase = Nothing

Response.Write "<h2 class='heading'>User Registration</font></h2>"
Response.Write "<p>Thank you for your registration, if you wish you may
now <a href='/joynermorgan/index.asp'>go home</a>."

else

Response.Redirect "/joynermorgan/register.asp?retry=usernameunavail"

end if

%>

I am fully aware that my coding techniques are out of date and therefore
will seem a little strange but as I said before, when I had this website up
and running some 5 years ago I never had a problem with this code at all.

Does anybody have any suggestions as to what could be the problem here?

Any help given would be much appreciated.

Many thanks in advance.

Spencer

Aug 20 '07 #1
11 2861
schurst30 wrote:
Hi, I am currently trying to get back into ASP and have begun looking
at an old webpage I developed some years ago, it was fully functional
back in 2002 and I had it up and running with no problems. I have
just recently bought a new PC with Windows Vista Home Premium on it
and installed IIS.
Really? I don't use Vista, but I had been under the impression that IIS
would not run on the Home edition.
When I try and connect to my data base I get the
following error message retunred:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Disk or network error.

/joynermorgan/take_registration.asp, line 50
Line 50 looks like this:

writeDB.Open "joynerm"

joynerm is the system DSN that I created to connect to my database.

The following is the actual code from the file take_registration.asp
where the error is occuring:
<none of which is relevant>

This is most likely to be a permissions problem. All users of an Access
database require Modify (read/write/create/delete) permission on the
folder containing the database file. The "gotcha" is that the "user" in
IIS may not be you, depending on how you have your website configured.
If Anonymous access is enabled, then the "user" is the Internet Guest
Account (aka IUSR_machinename). So if you have not granted the IUSR
account permissions for that folder, your asp page will not be able to
make the connection.

See here for more: http://www.aspfaq.com/show.asp?id=2009

Also, it's got nothing to do with your problem, but you should stop
using the obsolete ODBC DSN. See:
http://www.aspfaq.com/show.asp?id=2126

--
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.
Aug 20 '07 #2
Bob Barrows [MVP] wrote on 20 aug 2007 in
microsoft.public.inetserver.asp.general:
Really? I don't use Vista, but I had been under the impression that IIS
would not run on the Home edition.
IIS doesn't under "Home-Basic", but does under "Home-Premium".

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 20 '07 #3
Thanks for your input Bob, I have checkedc the permissions settings for all
folders in wwwroot and the users, creator, system etc is all set to full
control for now? Does this rule out the fact that it could be a permissions
problem?

I did change the way I connect to the way you suggested which throws up a
different error message as follows:
Microsoft JET Database Engine error '80004005'

Unspecified error

/joynermorgan/take_registration.asp, line 54

Aug 20 '07 #4
Evertjan. wrote:
Bob Barrows [MVP] wrote on 20 aug 2007 in
microsoft.public.inetserver.asp.general:
>Really? I don't use Vista, but I had been under the impression that
IIS would not run on the Home edition.

IIS doesn't under "Home-Basic", but does under "Home-Premium".
Ah, did miss the "Premium" part ...

--
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.
Aug 20 '07 #5
schurst30 wrote:
Thanks for your input Bob, I have checkedc the permissions settings
for all folders in wwwroot and the users, creator, system etc is all
set to full control for now?
Overkill. The only folder that needs attention is the folder containing
the mdb file
Does this rule out the fact that it
could be a permissions problem?
I don't know - did your sweeping efforts include the folder containing
the mdb file? Did they include granting permission for the IUSR account?
Is your website set to Anonymous access?

--
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.
Aug 20 '07 #6
Bob,

Anonymous Authentication is enabled, the folder where the .mdb files is
located has the correct permissions associated with the IUSR account etc.

Still having no joy in everything I try.

Spencer
"Bob Barrows [MVP]" wrote:
schurst30 wrote:
Thanks for your input Bob, I have checkedc the permissions settings
for all folders in wwwroot and the users, creator, system etc is all
set to full control for now?

Overkill. The only folder that needs attention is the folder containing
the mdb file
Does this rule out the fact that it
could be a permissions problem?

I don't know - did your sweeping efforts include the folder containing
the mdb file? Did they include granting permission for the IUSR account?
Is your website set to Anonymous access?

--
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.
Aug 20 '07 #7
It's probably not a coding issue (I would like to see what you changed
your connection string to. It should contain the filesystem path to the
mdb file, not a url). Unfortunately, I don't have a machine with Vista
installed so I cannot test whether it's a Vista issue.
I'm assuming you are able to open the database in Access, correct?

Let's take ASP out of the picture. Create a file called testmdb.vbs
containing the following lines of code:

dim cn
set cn=createobject("adodb.connection")
cn.open "Provider=microsoft.jet.oledb.4.0;" & _
"data source=p:\ath\to\mdbfile.mdb"
cn.close

Save the file and double-click it to run it - any errors?
Oh! You have installed the Jet components on the machine, I hope?
And are you running the 64-bit version of Vista? if so you have to
configure IIS to run in 32-bit mode.
schurst30 wrote:
Bob,

Anonymous Authentication is enabled, the folder where the .mdb files
is located has the correct permissions associated with the IUSR
account etc.

Still having no joy in everything I try.

Spencer
"Bob Barrows [MVP]" wrote:
>schurst30 wrote:
>>Thanks for your input Bob, I have checkedc the permissions settings
for all folders in wwwroot and the users, creator, system etc is all
set to full control for now?

Overkill. The only folder that needs attention is the folder
containing the mdb file
>>Does this rule out the fact that it
could be a permissions problem?

I don't know - did your sweeping efforts include the folder
containing the mdb file? Did they include granting permission for
the IUSR account? Is your website set to Anonymous access?
--
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.
Aug 20 '07 #8

"schurst30" <sc*******@discussions.microsoft.comwrote in message
news:5F**********************************@microsof t.com...
Bob,

Anonymous Authentication is enabled, the folder where the .mdb files is
located has the correct permissions associated with the IUSR account etc.

Still having no joy in everything I try.

You dont have the database open do you?
your error occers iof you dont have permissions or if you have the database
open

http://support.microsoft.com/kb/306269
>
Spencer
"Bob Barrows [MVP]" wrote:
>schurst30 wrote:
Thanks for your input Bob, I have checkedc the permissions settings
for all folders in wwwroot and the users, creator, system etc is all
set to full control for now?

Overkill. The only folder that needs attention is the folder containing
the mdb file
Does this rule out the fact that it
could be a permissions problem?

I don't know - did your sweeping efforts include the folder containing
the mdb file? Did they include granting permission for the IUSR account?
Is your website set to Anonymous access?

--
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.
Aug 20 '07 #9
I created that file and it thre up an error:

Line 3
Char 1
Error: 'p:\ath\to\mdbfile.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.
Code: 80004005
Source: Microsoft JET Database Engine

I am running the 32 bit Vista so that shouldn't be a problem, I do not know
if the JET files are installed? This could be an issue, how do I check/do
this?

Many Thanks

Spencer

"Bob Barrows [MVP]" wrote:
It's probably not a coding issue (I would like to see what you changed
your connection string to. It should contain the filesystem path to the
mdb file, not a url). Unfortunately, I don't have a machine with Vista
installed so I cannot test whether it's a Vista issue.
I'm assuming you are able to open the database in Access, correct?

Let's take ASP out of the picture. Create a file called testmdb.vbs
containing the following lines of code:

dim cn
set cn=createobject("adodb.connection")
cn.open "Provider=microsoft.jet.oledb.4.0;" & _
"data source=p:\ath\to\mdbfile.mdb"
cn.close

Save the file and double-click it to run it - any errors?
Oh! You have installed the Jet components on the machine, I hope?
And are you running the 64-bit version of Vista? if so you have to
configure IIS to run in 32-bit mode.
schurst30 wrote:
Bob,

Anonymous Authentication is enabled, the folder where the .mdb files
is located has the correct permissions associated with the IUSR
account etc.

Still having no joy in everything I try.

Spencer
"Bob Barrows [MVP]" wrote:
schurst30 wrote:
Thanks for your input Bob, I have checkedc the permissions settings
for all folders in wwwroot and the users, creator, system etc is all
set to full control for now?

Overkill. The only folder that needs attention is the folder
containing the mdb file

Does this rule out the fact that it
could be a permissions problem?

I don't know - did your sweeping efforts include the folder
containing the mdb file? Did they include granting permission for
the IUSR account? Is your website set to Anonymous access?

--
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.
Aug 20 '07 #10
Apologies for this, I changed the path to that where my database is and the
script never threw up any errors at all?! What could this mean?

"schurst30" wrote:
I created that file and it thre up an error:

Line 3
Char 1
Error: 'p:\ath\to\mdbfile.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.
Code: 80004005
Source: Microsoft JET Database Engine

I am running the 32 bit Vista so that shouldn't be a problem, I do not know
if the JET files are installed? This could be an issue, how do I check/do
this?

Many Thanks

Spencer

"Bob Barrows [MVP]" wrote:
It's probably not a coding issue (I would like to see what you changed
your connection string to. It should contain the filesystem path to the
mdb file, not a url). Unfortunately, I don't have a machine with Vista
installed so I cannot test whether it's a Vista issue.
I'm assuming you are able to open the database in Access, correct?

Let's take ASP out of the picture. Create a file called testmdb.vbs
containing the following lines of code:

dim cn
set cn=createobject("adodb.connection")
cn.open "Provider=microsoft.jet.oledb.4.0;" & _
"data source=p:\ath\to\mdbfile.mdb"
cn.close

Save the file and double-click it to run it - any errors?
Oh! You have installed the Jet components on the machine, I hope?
And are you running the 64-bit version of Vista? if so you have to
configure IIS to run in 32-bit mode.
schurst30 wrote:
Bob,
>
Anonymous Authentication is enabled, the folder where the .mdb files
is located has the correct permissions associated with the IUSR
account etc.
>
Still having no joy in everything I try.
>
Spencer
>
>
"Bob Barrows [MVP]" wrote:
>
>schurst30 wrote:
>>Thanks for your input Bob, I have checkedc the permissions settings
>>for all folders in wwwroot and the users, creator, system etc is all
>>set to full control for now?
>>
>Overkill. The only folder that needs attention is the folder
>containing the mdb file
>>
>>Does this rule out the fact that it
>>could be a permissions problem?
>>
>I don't know - did your sweeping efforts include the folder
>containing the mdb file? Did they include granting permission for
>the IUSR account? Is your website set to Anonymous access?
--
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.

Aug 20 '07 #11
Thanks for the belly laugh :-)

It means
1. Jet is properly installed and
2. You still have a permissions problem.

You may need to grant permission to the IWAM account as well as the IUSR
account, especially if that code you posted is being run in global.asa.

schurst30 wrote:
Apologies for this, I changed the path to that where my database is
and the script never threw up any errors at all?! What could this
mean?

"schurst30" wrote:
>I created that file and it thre up an error:

Line 3
Char 1
Error: 'p:\ath\to\mdbfile.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.
Code: 80004005
Source: Microsoft JET Database Engine

I am running the 32 bit Vista so that shouldn't be a problem, I do
not know if the JET files are installed? This could be an issue, how
do I check/do this?

Many Thanks

Spencer

"Bob Barrows [MVP]" wrote:
>>It's probably not a coding issue (I would like to see what you
changed your connection string to. It should contain the filesystem
path to the mdb file, not a url). Unfortunately, I don't have a
machine with Vista installed so I cannot test whether it's a Vista
issue.
I'm assuming you are able to open the database in Access, correct?

Let's take ASP out of the picture. Create a file called testmdb.vbs
containing the following lines of code:

dim cn
set cn=createobject("adodb.connection")
cn.open "Provider=microsoft.jet.oledb.4.0;" & _
"data source=p:\ath\to\mdbfile.mdb"
cn.close

Save the file and double-click it to run it - any errors?
Oh! You have installed the Jet components on the machine, I hope?
And are you running the 64-bit version of Vista? if so you have to
configure IIS to run in 32-bit mode.
schurst30 wrote:
Bob,

Anonymous Authentication is enabled, the folder where the .mdb
files is located has the correct permissions associated with the
IUSR account etc.

Still having no joy in everything I try.

Spencer
"Bob Barrows [MVP]" wrote:

schurst30 wrote:
>Thanks for your input Bob, I have checkedc the permissions
>settings for all folders in wwwroot and the users, creator,
>system etc is all set to full control for now?
>
Overkill. The only folder that needs attention is the folder
containing the mdb file
>
>Does this rule out the fact that it
>could be a permissions problem?
>
I don't know - did your sweeping efforts include the folder
containing the mdb file? Did they include granting permission for
the IUSR account? Is your website set to Anonymous access?

--
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.
--
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.
Aug 20 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
Hello I am trying to rebuild indexes on our DB, but I am running into an error I am not able to solve. Server: Msg 1105, Level 17, State 2, Line 1 Could not allocate space for object 'ft' in...
1
by: intl04 | last post by:
I am getting strange print-related error messages when trying to create (not print!) reports. For example, when I click 'new' to create a report then choose 'design view', I get an error message...
9
by: Jeremy | last post by:
I have a situation where i am trying to run two query's and retrieve one record from each query, then using Union combine them into one recordset. The First Query is strait forward and should just...
1
by: kito | last post by:
Hi, I have a problem, when I want to access to my SQL Server Express database from my ASP.NET application. My workstation ID is KITOLAP-HP My username is user01 Now I built the following...
4
by: =?Utf-8?B?VGVycmFuY2U=?= | last post by:
I have an application that runs fine on my machine(of course) that access the local Sql Server. However, when trying to run this application from another machine I receive a Sql timeout error. I...
2
by: bizt | last post by:
Hi, I am performing an XSLT on a XML feed. The XSLT produces me with PHP code that I eval then insert into my DB. However, the way that the system Im assigned to is setup, I need to convert all...
5
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@...
0
mikek12004
by: mikek12004 | last post by:
I want to move some data from one table to another but when I press finish after specifing my parameters to the wizard (in the last step I choose 'execute now') I get this error message: " -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.