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

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

am 20.08.2007 15:24:05 von schurst30

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 "

User Registration

"
Response.Write "

Thank you for your registration, if you wish you may
now ."

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

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

am 20.08.2007 15:49:08 von reb01501

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:


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.

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

am 20.08.2007 15:56:33 von exjxw.hannivoort

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)

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

am 20.08.2007 16:20:03 von schurst30

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

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

am 20.08.2007 17:26:17 von reb01501

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.

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

am 20.08.2007 17:28:36 von reb01501

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.

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

am 20.08.2007 17:48:02 von schurst30

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.
>
>
>

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

am 20.08.2007 18:01:39 von reb01501

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.

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

am 20.08.2007 18:06:30 von me

"schurst30" wrote in message
news:5FB1B8A5-C552-4671-B21E-3E5455F304ED@microsoft.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.
>>
>>
>>

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

am 20.08.2007 18:26:03 von schurst30

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.
>
>
>

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

am 20.08.2007 18:28:03 von schurst30

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.
> >
> >
> >

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

am 20.08.2007 20:06:56 von reb01501

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.