p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP 3.0 (http://p2p.wrox.com/forumdisplay.php?f=27)
-   -   Chapter 14--SQLUpdate.asp Try it out (http://p2p.wrox.com/showthread.php?t=8876)

JB977 February 2nd, 2004 06:54 PM

Chapter 14--SQLUpdate.asp Try it out
 
I seem to have hit a road block on this try it out. I am getting an error when I run this in my browser:

Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/aspfiles/sqlupdate.asp, line 30

I checked the code many times even letter by letter. (I missed a punctuation in chapter 12) and everything checks out. I even used the code from the Wrox downloads. Same error.

Here is the code:

<%
    option explicit
    dim strConnect
%>





<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Using SQL's UPDATE Command and the ADO Command Object</title>
</head>

<body>
<%
    dim objComm, intNoOfRecords
    Set objComm = Server.CreateObject("ADODB.Command")

    Response.Write "<B>Harry the Ham directs Quentin Tarantino films?</b><br>"
    objComm.ActiveConnection = strConnect

    objComm.CommandText = "UPDATE AllMovies SET Director = 'Harry the Ham' " &_
                        "WHERE Director LIKE 'Quentin Tarantino'"
    objComm.CommandType=adCmdText
    objComm.Execute intNoOfRecords

    Response.Write "This UPDATE command has affected " & intNoOfRecords & " records<br><br>"

    Response.Write "<b>Tarantino returned to his rightful place as director:</b><br>"
    objComm.CommandText = "UPDATE AllMovies SET Director = 'Quentin Tarantino' " &_
                        "WHERE Director LIKE 'Harry the Ham'"

    objComm.Execute intNoOFRecords
    Response.Write "This UPDATE command has affected " & intNoOfRecords & " records<br><br>"

    Set objComm = Nothing
%>
</body>

</html>

I checked the Access files and nothing seems to be configured to make the database "un-updateable"

Any ideas?

BTW there is nothing on the errata list I downloaded from this site (it has chapter 8's errors then skips to chapter 15 for the application)

Thanks,
JB977

pgtips February 3rd, 2004 05:03 AM

http://www.aspfaq.com/show.asp?id=2062

JB977 February 3rd, 2004 10:33 PM

Quote:

quote:Originally posted by pgtips
 http://www.aspfaq.com/show.asp?id=2062
Thanks for the tip, I went there and found a few articles from that source and the MS KB but it is rather confusing how to get the permissions set up correctly. I tried to do what the KB articles said and I still get the error.

 Anyone have a source with a clear explanation of how to go about this? Seems rather complicated and involves a lot of tinkering. The book almost makes it seem like it should work easily w/out going through a lot of hoops to make this "try it out" work."

Thanks,
JB977

pgtips February 4th, 2004 09:06 AM

For starters I would check 2 basic things. In Windows Explorer, right-click the folder where the mdb file resides, and choose 'Properties' from the pop-up menu
1. is the mdb file marked as read-only within windows (unlikely but worth checking anyway)
2. on the security tab, check that IUSR_machineName is listed in the 'Group or user names' list.
2.1 If it is listed, check that it has read and write permissions (if it doesn't then add them by checking the relevant box in the bottom list)
2.2 If it isn't listed, use the Add button to add it to the list, then check the read and write boxes in the bottom list.

Let us know how you get on.
rgds
Phil

john_reeve41 February 4th, 2004 09:34 AM

Hi,

I had the same problem, I managed to get it sorted. Heres how:

http://p2p.wrox.com/topic.asp?TOPIC_ID=9360

Cheers,

John.

JB977 February 4th, 2004 02:08 PM

Quote:

quote:Originally posted by john_reeve41
 Hi,

I had the same problem, I managed to get it sorted. Heres how:

http://p2p.wrox.com/topic.asp?TOPIC_ID=9360

Cheers,

John.
Well, that did the trick! Thank you for your help both of you (john_reeves41 and pgtips). It is weird, but the MS KB on file sharing says you should have the simple file sharing checked. Funny thing is, I remember seeing the security tab in the folder properties before when exploring XP after installing it. No doubt I will run into more problems as I wade my way through this book. Once I hit Chapter 15 the errors report will help me again, as my edition was an earlier version. If I need help again, I'll be back! Thanks again!

Thanks,
JB977


All times are GMT -4. The time now is 01:01 AM.

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