ro6er
Programmer
- Jul 1, 2003
- 76
Hi, I'm having some issues with using update on my form page. It might be something simple but i've been looking at it for days now and can't figure it out. I've tried loads of things which i'll now list. Here is the code for the first form page:
Here is the second part:
i know the data is being past across ok as I checked with the following code on the second part:
Which brings back
Which seems fine.
The database table looks like this:
ID Autonumber
Description Memo
Subcat Text
Image Text
catagories Text
price Text
The exact error message is:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in UPDATE statement.
/buckles/admin/upload.asp, line 23
Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)
Page:
POST 29628 bytes to /buckles/admin/upload.asp
POST Data:
error '80020009'
Exception occurred.
/iisHelp/common/500-100.asp, line 223
As well line 23 is:
I've also tried running the update statement directly in the database which seems to work fine
Any idea will be greatly recieved.
Thanks,
Roger
Code:
<form method="post" enctype="multipart/form-data" action="upload.asp">
<%Session("ID") = rsBuckles("ID")%>
<input type="file" size="40" name="file1"><br />
<input type="submit" value="Upload!">
</form>
Here is the second part:
Code:
<!--#include file="database.asp"-->
<!--#include file="cls_CBUpload.asp" --><%
dim Upload, File, Item, iTimer
iTimer = Timer()
set Upload = new cls_CBUpload
Response.Write("File count: " & Upload.Files.Count)
Response.Write("<br /><br />")
for each File in Upload.Files
set File = Upload.Files(File)
Response.Write(Server.Mappath("/buckles/buckleimages/" & File.Name) & "<br />")
Response.Write(File.Size & " bytes<br />")
Response.Write(File.FormName & "<br />")
Response.Write(File.ContentType & "<br />")
Response.Write ("<br><br>")
'Add the image name to the database
mySQL = "UPDATE "&Session("edit")&" SET Image = '"&File.Name&"'" _
& " WHERE ID = '"&Session("ID")&"'"
Set RS = Conn.Execute(mySQL)
if(File.SaveToFile(Server.Mappath("/buckles/buckleimages/" & File.Name))) then
Response.Write("Saved file...<br />")
end if
Response.Write("<br />")
next
for each Item in Upload.Form
Response.Write(Item & ": " & Upload.Form(Item) & "<br />")
next
set Upload = nothing
Response.Write(Timer - iTimer)
%>
i know the data is being past across ok as I checked with the following code on the second part:
Code:
mySQL = "UPDATE "&Session("edit")&" SET Image = '"&File.Name&"'" _
& " WHERE ID = '"&Session("ID")&"'"
response.write mySQL
response.end
Rs.Open mySQL, Conn
Conn.Close
Set Rs=Nothing
Code:
UPDATE flagsnposters SET Image = 'test.jpg' WHERE ID = 23
The database table looks like this:
ID Autonumber
Description Memo
Subcat Text
Image Text
catagories Text
price Text
The exact error message is:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in UPDATE statement.
/buckles/admin/upload.asp, line 23
Browser Type:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1)
Page:
POST 29628 bytes to /buckles/admin/upload.asp
POST Data:
error '80020009'
Exception occurred.
/iisHelp/common/500-100.asp, line 223
As well line 23 is:
Code:
Set RS = Conn.Execute(mySQL)
I've also tried running the update statement directly in the database which seems to work fine
Any idea will be greatly recieved.
Thanks,
Roger