nfinite
asked on
Microsoft JET Database Engine error '80004005'
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.
/add_file.asp, line 27
<%
Option Explicit
%>
<html>
<head>
<title>Add File To Data Base</title>
<style fprolloverstyle>A:hover {color: #FF0000; font-family: Verdana; font-size: 12pts.}
</style>
</head>
<body bgcolor="#FFE4CA" vlink="#0000FF">
<%
Dim FilePath, Description, conn, path, DsnAccess, rs, sqlstring
FilePath = Trim(Cstr(Request.Form("Fi lePath")))
Description = Trim(Cstr(Request.Form("De scription" )))
If FilePath <> "" and Description <> "" Then
set conn = server.createobject("adodb .connectio n")
path = server.mappath("filedb.mdb ")
DsnAccess = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source="& path
conn.open DsnAccess
set rs = server.createobject ("adodb.recordset")
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
set rs = conn.execute(sqlstring)
conn.close
set rs = nothing
set conn = nothing
Response.Write "<font face=""Verdana"" size=""2"">File successfully submited!</font>"
Response.Write "<p><font face=""Verdana"" size=""2""><a href=""add_file.asp"">Subm it More Files</a> | <a href=""default.asp"">Execu te Files</a> | <a href=""delete.asp"">Delete Files</a></font></p>"
Else
%><form method="POST" action="add_file.asp">
<p>
<font face="Verdana"><b>Choose File to Add to Data Base</b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="13%">
<font face="Verdana" size="2">File Path:</font></td>
<td width="87%">
<input type="file" name="FilePath" size="60" style="font-family: Verdana; font-size: 12pts."><font face="Verdana" size="2"> </font>
<font size="2">(*)</font></td>
</tr>
<tr>
<td width="13%">
<font face="Verdana" size="2">File Description:</font></td>
<td width="87%">
<input type="text" name="Description" size="60" style="font-family: Verdana; font-size: 12pts."></td>
</tr>
</table>
<p>
<font face="Verdana"><font size="1">(*) only .exe files are supported!<br>
</font><br>
<input type="submit" value="Submit" name="Submit" style="font-family: Verdana; font-size: 12pts.">
<input type="reset" value="Reset" name="Reset" style="font-family: Verdana; font-size: 12pts."></font></p>
</form>
<p><font face="Verdana" size="2"><a href="upl.asp">Execute Files</a> | <a href="delete.asp">Delete Files</a></font></p>
<%
End If
%>
</body>
</html>
Any suggestions?
Operation must use an updateable query.
/add_file.asp, line 27
<%
Option Explicit
%>
<html>
<head>
<title>Add File To Data Base</title>
<style fprolloverstyle>A:hover {color: #FF0000; font-family: Verdana; font-size: 12pts.}
</style>
</head>
<body bgcolor="#FFE4CA" vlink="#0000FF">
<%
Dim FilePath, Description, conn, path, DsnAccess, rs, sqlstring
FilePath = Trim(Cstr(Request.Form("Fi
Description = Trim(Cstr(Request.Form("De
If FilePath <> "" and Description <> "" Then
set conn = server.createobject("adodb
path = server.mappath("filedb.mdb
DsnAccess = "Provider=Microsoft.Jet.OL
conn.open DsnAccess
set rs = server.createobject ("adodb.recordset")
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
set rs = conn.execute(sqlstring)
conn.close
set rs = nothing
set conn = nothing
Response.Write "<font face=""Verdana"" size=""2"">File successfully submited!</font>"
Response.Write "<p><font face=""Verdana"" size=""2""><a href=""add_file.asp"">Subm
Else
%><form method="POST" action="add_file.asp">
<p>
<font face="Verdana"><b>Choose File to Add to Data Base</b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="13%">
<font face="Verdana" size="2">File Path:</font></td>
<td width="87%">
<input type="file" name="FilePath" size="60" style="font-family: Verdana; font-size: 12pts."><font face="Verdana" size="2"> </font>
<font size="2">(*)</font></td>
</tr>
<tr>
<td width="13%">
<font face="Verdana" size="2">File Description:</font></td>
<td width="87%">
<input type="text" name="Description" size="60" style="font-family: Verdana; font-size: 12pts."></td>
</tr>
</table>
<p>
<font face="Verdana"><font size="1">(*) only .exe files are supported!<br>
</font><br>
<input type="submit" value="Submit" name="Submit" style="font-family: Verdana; font-size: 12pts.">
<input type="reset" value="Reset" name="Reset" style="font-family: Verdana; font-size: 12pts."></font></p>
</form>
<p><font face="Verdana" size="2"><a href="upl.asp">Execute Files</a> | <a href="delete.asp">Delete Files</a></font></p>
<%
End If
%>
</body>
</html>
Any suggestions?
Check that your internet user account has "write" permissions for this file, this is 99% the reason of this error.
Some extra info:
Internet guest accounts default username is usually IUSR_<servername> (if your server name is WEB, then it should be IUSR_WEB).
The permissions are usually lost when you overwrite the MDB file over FTP or copy it over.
Internet guest accounts default username is usually IUSR_<servername> (if your server name is WEB, then it should be IUSR_WEB).
The permissions are usually lost when you overwrite the MDB file over FTP or copy it over.
ASKER
I'm using www.verio.com hosting.How can i put right permissions for it?
You can't really get a recordset back from an INSERT, only from a SELECT. This should help:
strDataPath = server.mappath("filedb.mdb ")
strConnectionString = "Provider=Microsoft.Jet.OL EDB.4.0;Us er ID=Admin;"_
& " Data Source= " & strDataPath & ";"_
& " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Set objConnection = Server.CreateObject("ADODB .Connectio n")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
objConnection.Open strConnectionString
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
objConnection.Execute(sqls tring)
strDataPath = server.mappath("filedb.mdb
strConnectionString = "Provider=Microsoft.Jet.OL
& " Data Source= " & strDataPath & ";"_
& " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Set objConnection = Server.CreateObject("ADODB
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
objConnection.Open strConnectionString
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
objConnection.Execute(sqls
For other causes of the dreaded error '80004005' please see:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q306518
http://www.webwizguide.info/asp/faq/access_database_faq.asp
FtB
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q306518
http://www.webwizguide.info/asp/faq/access_database_faq.asp
FtB
Oh, since you are using option explicit (always a good idea) we need to be more careful:
Dim FilePath, Description, conn, path, DsnAccess, rs, sqlstring
FilePath = Trim(Cstr(Request.Form("Fi lePath")))
Description = Trim(Cstr(Request.Form("De scription" )))
If FilePath <> "" and Description <> "" Then
dim strDataPath, strConnectionString, objConnection, sqlstring
strDataPath = server.mappath("filedb.mdb ")
strConnectionString = "Provider=Microsoft.Jet.OL EDB.4.0;Us er ID=Admin;"_
& " Data Source= " & strDataPath & ";"_
& " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Set objConnection = Server.CreateObject("ADODB .Connectio n")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
objConnection.Open strConnectionString
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
objConnection.Execute(sqls tring)
Dim FilePath, Description, conn, path, DsnAccess, rs, sqlstring
FilePath = Trim(Cstr(Request.Form("Fi
Description = Trim(Cstr(Request.Form("De
If FilePath <> "" and Description <> "" Then
dim strDataPath, strConnectionString, objConnection, sqlstring
strDataPath = server.mappath("filedb.mdb
strConnectionString = "Provider=Microsoft.Jet.OL
& " Data Source= " & strDataPath & ";"_
& " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Set objConnection = Server.CreateObject("ADODB
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
objConnection.Open strConnectionString
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
objConnection.Execute(sqls
ASKER
to fritz_the_blank
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'strDataPath'
/add_file.asp, line 21
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'strDataPath'
/add_file.asp, line 21
Oops, did you see my last post with the variables dimensioned?
FtB
FtB
ASKER
Microsoft VBScript compilation error '800a0411'
Name redefined
/add_file.asp, line 19
dim strDataPath, strConnectionString, objConnection, sqlstring
Name redefined
/add_file.asp, line 19
dim strDataPath, strConnectionString, objConnection, sqlstring
Okay, hang on a second and I'll redo all of this in one post.
FtB
FtB
This should be it:
<%
Option Explicit
%>
<html>
<head>
<title>Add File To Data Base</title>
<style fprolloverstyle>A:hover {color: #FF0000; font-family: Verdana; font-size: 12pts.}
</style>
</head>
<body bgcolor="#FFE4CA" vlink="#0000FF">
<%
Dim FilePath, Description
FilePath = Trim(Cstr(Request.Form("Fi lePath")))
Description = Trim(Cstr(Request.Form("De scription" )))
FilePath = Trim(Cstr(Request.Form("Fi lePath")))
Description = Trim(Cstr(Request.Form("De scription" )))
If FilePath <> "" and Description <> "" Then
dim strDataPath, strConnectionString, objConnection, sqlstring
strDataPath = server.mappath("filedb.mdb ")
strConnectionString = "Provider=Microsoft.Jet.OL EDB.4.0;Us er ID=Admin;"_
& " Data Source= " & strDataPath & ";"_
& " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Set objConnection = Server.CreateObject("ADODB .Connectio n")
objConnection.ConnectionTi meout = 15
objConnection.CommandTimeo ut = 10
objConnection.Mode = 3 'adModeReadWrite
objConnection.Open strConnectionString
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
objConnection.Execute(sqls tring)
Response.Write "<font face=""Verdana"" size=""2"">File successfully submited!</font>"
Response.Write "<p><font face=""Verdana"" size=""2""><a href=""add_file.asp"">Subm it More Files</a> | <a href=""default.asp"">Execu te Files</a> | <a href=""delete.asp"">Delete Files</a></font></p>"
objConnection.Close
set objConnection = Nothing
Else
%><form method="POST" action="add_file.asp">
<p>
<font face="Verdana"><b>Choose File to Add to Data Base</b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="13%">
<font face="Verdana" size="2">File Path:</font></td>
<td width="87%">
<input type="file" name="FilePath" size="60" style="font-family: Verdana; font-size: 12pts."><font face="Verdana" size="2"> </font>
<font size="2">(*)</font></td>
</tr>
<tr>
<td width="13%">
<font face="Verdana" size="2">File Description:</font></td>
<td width="87%">
<input type="text" name="Description" size="60" style="font-family: Verdana; font-size: 12pts."></td>
</tr>
</table>
<p>
<font face="Verdana"><font size="1">(*) only .exe files are supported!<br>
</font><br>
<input type="submit" value="Submit" name="Submit" style="font-family: Verdana; font-size: 12pts.">
<input type="reset" value="Reset" name="Reset" style="font-family: Verdana; font-size: 12pts."></font></p>
</form>
<p><font face="Verdana" size="2"><a href="upl.asp">Execute Files</a> | <a href="delete.asp">Delete Files</a></font></p>
<%
End If
%>
</body>
</html>
<%
Option Explicit
%>
<html>
<head>
<title>Add File To Data Base</title>
<style fprolloverstyle>A:hover {color: #FF0000; font-family: Verdana; font-size: 12pts.}
</style>
</head>
<body bgcolor="#FFE4CA" vlink="#0000FF">
<%
Dim FilePath, Description
FilePath = Trim(Cstr(Request.Form("Fi
Description = Trim(Cstr(Request.Form("De
FilePath = Trim(Cstr(Request.Form("Fi
Description = Trim(Cstr(Request.Form("De
If FilePath <> "" and Description <> "" Then
dim strDataPath, strConnectionString, objConnection, sqlstring
strDataPath = server.mappath("filedb.mdb
strConnectionString = "Provider=Microsoft.Jet.OL
& " Data Source= " & strDataPath & ";"_
& " Mode=Share Deny None;User Id=admin;PASSWORD=;"
Set objConnection = Server.CreateObject("ADODB
objConnection.ConnectionTi
objConnection.CommandTimeo
objConnection.Mode = 3 'adModeReadWrite
objConnection.Open strConnectionString
sqlstring = "insert into list(description, filepath) values('" & Description & "', '" & FilePath & "')"
objConnection.Execute(sqls
Response.Write "<font face=""Verdana"" size=""2"">File successfully submited!</font>"
Response.Write "<p><font face=""Verdana"" size=""2""><a href=""add_file.asp"">Subm
objConnection.Close
set objConnection = Nothing
Else
%><form method="POST" action="add_file.asp">
<p>
<font face="Verdana"><b>Choose File to Add to Data Base</b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="13%">
<font face="Verdana" size="2">File Path:</font></td>
<td width="87%">
<input type="file" name="FilePath" size="60" style="font-family: Verdana; font-size: 12pts."><font face="Verdana" size="2"> </font>
<font size="2">(*)</font></td>
</tr>
<tr>
<td width="13%">
<font face="Verdana" size="2">File Description:</font></td>
<td width="87%">
<input type="text" name="Description" size="60" style="font-family: Verdana; font-size: 12pts."></td>
</tr>
</table>
<p>
<font face="Verdana"><font size="1">(*) only .exe files are supported!<br>
</font><br>
<input type="submit" value="Submit" name="Submit" style="font-family: Verdana; font-size: 12pts.">
<input type="reset" value="Reset" name="Reset" style="font-family: Verdana; font-size: 12pts."></font></p>
</form>
<p><font face="Verdana" size="2"><a href="upl.asp">Execute Files</a> | <a href="delete.asp">Delete Files</a></font></p>
<%
End If
%>
</body>
</html>
ASKER
Microsoft JET Database Engine error '80004005'
Operation must use an updateable query.
/add_file.asp, line 31
same thing as before.
Operation must use an updateable query.
/add_file.asp, line 31
same thing as before.
Okay, the code looks good, so we need to return to j2nku's concern about permissions (we still had to do what we did above, however, so this wasn't wasted time).
Is this your server or are you using a hosting service?
FtB
Is this your server or are you using a hosting service?
FtB
ASKER
i'm using hosting at www.verio.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Any reason for the grade of C here?
FtB
FtB
The permission problem solved this for me, thank you again! Someone changed permissions for the site in Frontpage and somehow this replaced the permissions on this file.
Glad to have helped,
FtB
FtB