Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

asp/vbscript runtime error 424

Posted on 2004-03-22
3
Medium Priority
?
1,865 Views
Last Modified: 2012-06-22
I am trying to update a microsoft access database via asp page using an update sql query.
When submitting the page the error message that occurs by using the err.number after the query executing the message is "error 424".
There is no file permission error at all. I have made sure that the database file itself has a full read and write permissions and security access rights are set correctly throughout. eg, "everyone" and "anonymous internet user" etc

The asp is running on IIS 5.0 on 2k server

The select query using the object stated below works previously on other pages to retrieve data, but  not to update.
There is an object required according to the error code, but it has not become apparent to myself.

Code is below;


<html>
<head>
<title>Submit DataBase</title>
</head>
<body>
<h2>Submit to Database</h2>

<%on error resume next

'dim conn as adodb.connection
'dim no as string
'dim sql as string
'dim err as exception

dim conn
set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.Jet.OLEDB.4.0"
'conn.Mode = 3 ' 3 = adModeReadWrite
conn.open(server.mappath("hotel.mdb"))

 if Request.form("action")="Save" then
      no=Request.Form("no")
      sql="UPDATE bookings SET [CustomerName]='" & Request.Form("CustomerName") & "',"
      sql=sql & "[telNo]='" & Request.Form("telNo") &  "' WHERE bookings.[BookingID]=" & no

     

 conn.Execute sql, Recordsaffected
 reponse.write(sql)
 if err <> 0 then
       response.write(err.number)
       'Response.Write("Permission denied")
 else
       Response.Write("Record number " & no & " was updated.")
 end if
 end if  


conn.close%>


</body>
</html>


if you require additional source code, then please reply and this will be provided, either on this page, or in a file format in a method of your choosing.

Please help me out, this is doing my head in!!

Thanks

Gary








0
Comment
Question by:sarczoid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 21

Accepted Solution

by:
ap_sajith earned 1000 total points
ID: 10655379
Try this..

<%on error resume next

'dim conn as adodb.connection
'dim no as string
'dim sql as string
'dim err as exception

dim conn
set conn=Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("hotel.mdb") &";User Id=;Password=;"

 if Request.form("action")="Save" then
      no=Request.Form("no")
      sql="UPDATE bookings SET [CustomerName]='" & Request.Form("CustomerName") & "',"
      sql=sql & "[telNo]='" & Request.Form("telNo") &  "' WHERE bookings.[BookingID]=" & no

     

 conn.Execute (sql)
 reponse.write(sql)
 if err <> 0 then
      response.write(err.number)
      'Response.Write("Permission denied")
 else
      Response.Write("Record number " & no & " was updated.")
 end if
 end if  


conn.close
' ** CLEANUP**
set conn=nothing
%>


</body>

Cheers!
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10657278
Never put "on error resume next" in your code until your absolutely sure it works.  I then I wouldn't do it either...but that's up to you.

If you take it out, ASP Runtime will tell you where the error is and what the problem is.  Then you can post that error message here, and we will solve your problem.
0
 

Author Comment

by:sarczoid
ID: 10658109
ap_sajith,

thankyou for your help, i accepted your answer.

thanks

Gary
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question