Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2010, 11:55 AM
Registered User
 
Join Date: Jun 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Question Chapter 12 - Testing our data Store

Hi

Hopefully someone can help - many thanks in advance.

I am running Windows 7 Ultimate IIS 7.5, Access2007 and have tried to use the code on page 475 "testing our data store" but keep getting the HTTP 500 error. Is this a problem with my IIS configuration? - I have checked the coding zillions of times and can find no errors see below
Code:
<%Option Explicit%>
<html>
<head>
<title>Testing our connection</title>
</head>
<body>
<%
 Dim adOpenForwardOnly, adLockReadOnly, adCmdTable
 adOpenForwardOnly = 0
 adLockReadOnly = 1
 adCmdTable = 2
 
 Dim objConn, objRS
 
 Set objConn = Server.CreateObject("ADODB.Connection")
 Set objRS = Server.CreateObject("ADODB.Recordset")
 
 Dim strDatabaseType
 strDatabaseType = "Access"
 'strDatabaseType = "MSDE"
 
 If strDatabaseType = "Access" Then
  objConn.Open "Provider=Microsoft.Jet.OLEDB.*;" & "Data Source=E:\ASP\databases\Movie2000.mdb;" & "Persist Security Info=False"
 
 Else
 
  objConn.Open "Provider=SQLOLEDB;Persist Security Info=False;" & "User ID=sa;Initial Catalog=Movie;" & "Initial File name=E:\MSSQL7\Data\Movie2000.mdf"
 
 End If
 
  objRS.Open "Movies", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable
 
 While Not objRS.EOF
  Response.Write objRS("Title") & "<br>"
  objRS.MoveNext
 Wend
 
 objRS.Close
 objConn.Close
 Set objRS = Nothing
 Set objConn = Nothing
 
 
%>
</body>
</html>
The code shows no problems until I get to the "If Then" bit then stops. IIS is running and will allow me to display another very simple page with a link to this page but the link gives me the error message as above


Thanks again for any help
 
Old March 11th, 2010, 04:36 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

So is that *really* where your ".mdb" file is?

E:\ASP\databases\Movie2000.mdb

If not, fix it.

If so, it might be because IIS doesn't have permissions to that directory. Remember, your ASP code runs inside the IIS process, so it runs *as* the IIS user, *NOT* as your own user.

The IIS user is named IUSR_xxxx where xxxx is the name of the computer.

Make sure that IUSR_xxxx has read and write permissions in that directory and to that file.
 
Old March 18th, 2010, 01:03 PM
Registered User
 
Join Date: Jun 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thank you

hi

Thanks for your help.

I know that this is going to sound stupid but...

how do I give IIS_user access rights to the .mdb. Also it works fine on my PC (running XP), but not on my laptop which runs windows7.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 12: last try it out, Data is not being updated in the database jack_hilary BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 November 30th, 2009 04:01 PM
Chapter 12 Displaying and Updating Data bpl BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 November 25th, 2009 02:32 PM
Updating data (Chapter 12 p388) SouthendSupporter BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 July 3rd, 2009 10:03 AM
Updating data (Chapter 12 p388) SouthendSupporter BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 0 July 3rd, 2009 09:03 AM
Errors on Chapter 12 example(12.8) sonnie ASP.NET 2.0 Professional 2 June 7th, 2006 10:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.