4dam
11-04-2005, 01:31 PM
Hi,
I have a one record table, part of which consists of three fields which store image names.
menu_image_1, menu_image_2 and menu_image_3
To delete either of these images from the record, I am attempting to use the script below. The querystring "image" contains the field name of the appropriate image, and I am trying to dynamically insert it into the Query, but it keeps giving me a syntax error message:
<%
Dim empty_value
empty_value = null
Set rs_deleteimage = Server.CreateObject("ADODB.Recordset")
rs_deleteimage.ActiveConnection = MM_conn_db_STRING
rs_deleteimage.Source = "UPDATE tbl_menu SET ' " & request.querystring("image") & " ' = '" & empty_value
rs_deleteimage.CursorType = 0
rs_deleteimage.CursorLocation = 2
rs_deleteimage.LockType = 1
rs_deleteimage.Open()
response.Redirect("../control/menu_admin.asp")
rs_deleteimage.Close()
Set rs_deleteimage = Nothing
%>
What is the correct syntax for including this querystring in the query?
Thanks,
Adam
I have a one record table, part of which consists of three fields which store image names.
menu_image_1, menu_image_2 and menu_image_3
To delete either of these images from the record, I am attempting to use the script below. The querystring "image" contains the field name of the appropriate image, and I am trying to dynamically insert it into the Query, but it keeps giving me a syntax error message:
<%
Dim empty_value
empty_value = null
Set rs_deleteimage = Server.CreateObject("ADODB.Recordset")
rs_deleteimage.ActiveConnection = MM_conn_db_STRING
rs_deleteimage.Source = "UPDATE tbl_menu SET ' " & request.querystring("image") & " ' = '" & empty_value
rs_deleteimage.CursorType = 0
rs_deleteimage.CursorLocation = 2
rs_deleteimage.LockType = 1
rs_deleteimage.Open()
response.Redirect("../control/menu_admin.asp")
rs_deleteimage.Close()
Set rs_deleteimage = Nothing
%>
What is the correct syntax for including this querystring in the query?
Thanks,
Adam