Forums

ASP

This topic is locked

Microsoft][ODBC Microsoft Access Driver] Operation

Posted 28 Mar 2007 15:36:31
1
has voted
28 Mar 2007 15:36:31 Naeem Aslam posted:
Hey guys,

I need help on the following error

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

/cieadmin/addevents_action.asp, line 80

Any help in this regard will be highly appreciated

The Coding for the above file i.e. addevents_action.asp is as follows ...

-------------------------------------------------------------------------------------
<!--#include file="check.inc"-->
<!--#include file="links.asp"-->
<html>
<head>
<title>Add Events</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../styles.css" type="text/css">
</head>

<body bgcolor="#FFFFFF">

<%
Function FixForSQL(txt)
' replace each apostrophe with two
FixForSQL = Replace(txt,Chr(39),String(2,39))
End Function

' in this script we will check the variables
' passed from the form and make sure that required
' variable string actually contains data

dim eventdat
dim formdate
dim title
dim venue
dim program_fee
dim payment
dim head1
dim detail1
dim head2
dim detail2
dim head3
dim detail3
dim head4
dim detail4


formdate= request.form("eventdate"
title= request.form("title"
venue= request.form("venue"
head1= request.form("head1"
head2= request.form("head2"
head3= request.form("head3"
head4= request.form("head4"
program_fee= request.form("contents1"
payment= request.form("contents2"
detail1= request.form("contents3"
detail2= request.form("contents4"
detail3= request.form("contents5"
detail4= request.form("contents6"

eventdat = FormatDateTime(formdate,vbgeneraldate)



' ok now we've got our data so let's ship it off to the database

set conn = server.createobject("adodb.connection"
%>
<!--#include file="connect.asp"-->
<%
SQLstmt = "INSERT INTO events (event_date,title,venue,programe_fee,payment_mode,head1,detail1,head2,detail2,head3,detail3,head4,detail4)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & eventdat & "',"
SQLstmt = SQLstmt & "'" & title & "',"
SQLstmt = SQLstmt & "'" & venue & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(program_fee) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(payment) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(head1) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(detail1) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(head2) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(detail2) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(head3) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(detail3) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(head4) & "',"
SQLstmt = SQLstmt & "'" & FixForSQL(detail4) & "'"
SQLstmt = SQLstmt & ""


Set RS = conn.execute(SQLstmt)
If err.number>0 then
response.write "VBScript Errors Occured:" & "<P>"
response.write "Error Number=" & err.number & "<P>"
response.write "Error Descr.=" & err.description & "<P>"
response.write "Help Context=" & err.helpcontext & "<P>"
response.write "Help Path=" & err.helppath & "<P>"
response.write "Native Error=" & err.nativeerror & "<P>"
response.write "Source=" & err.source & "<P>"
response.write "SQLState=" & err.sqlstate & "<P>"
end if
IF conn.errors.count> 0 then
response.write "Database Errors Occured" & "<P>"
response.write SQLstmt & "<P>"
for counter= 0 to conn.errors.count
response.write "Error #" & conn.errors(counter).number & "<P>"
response.write "Error desc. -> " & conn.errors(counter).description & "<P>"
next
else
response.write "The Event <b>"& title &"</b> has been added.<p>"
response.write "<a href=addevents.asp>"
response.write "Add another EVENT </a>"

end if
Conn.Close
set Conn=nothing
%>


</body>
</html>
-------------------------------------------------------------------------------

Replies

Replied 30 Mar 2007 04:10:17
30 Mar 2007 04:10:17 Javier Castro replied:
Most likely is due to the lack of appropriate permissions on your DB directory. The users should have read and write permissions.

www.webthang.co.uk/Tuts/tuts_asp/gk_errors/gk_errors.asp#1
Replied 02 Apr 2007 08:57:01
02 Apr 2007 08:57:01 Naeem Aslam replied:
Thanks a ton Javier,

My prob is solved,

Reply to this topic