Hello! I have been regularly updating a website for a client, but I really only work in HTML or Flash. The client has a problem with the ASP side of their site, and has asked me for help. I don't really know anything about databases or query languages, and I'm not even sure what I am looking at. I did not write this code in question. The issue occurs when I am trying to upload an image. I am able to select the image no problem, but when I click the upload button, I receive this error:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'product_id ='.
/admin/update_product_image.asp, line 33
Here is the entire code sample:
<!--#include file="include/include.inc"-->
<%
'CheckAdminLogin ()
' Variables
Dim mySmartUpload
Dim intCount
' Object creation
Set mySmartUpload = Server.CreateObject("Persits.Upload")
' Upload
' mySmartUpload.Upload
' Save the files with their original names
Count=mySmartUpload.Save("C:\Inetpub\www.website.com\products")
' intCount = mySmartUpload.Save("C:\Inetpub\www.website.com\products")
' intCount = mySmartUpload.Save("c:\website\www\products")
product_id=mySmartUpload.Form("product_id")
'Save the file info in the DB
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Session ("ConnectionString")
SQL = "UPDATE products " & " SET product_image = '" & MySmartUpLoad.Files(1).FileName & "'WHERE product_id =" & product_id
Conn.Execute(SQL)
response.redirect "edit_product.asp?product_id=" & product_id
%>
I've been searching online and through these forums to no avail. Any assistance would be greatly appreciated. I'm sure it's just a small error that I don't recognize. Thanks very much!