ASP刪除一個表內字段中指定的內容:
如A表中的A1,A2,A3,A4,A5五人字段
其中A3為存儲圖片.存儲格式為:
Pic1.jpg,Pic2.jpg,Pic3.jpg,Pic4.jpg
如果要指定刪除其中一張例Pic3.jpg而其它保留.
ASP/Visual Basic代碼
- uPic=Request("Pic")
-
- Str=Request("nPic")
-
- Str=Replace(Str,uPic",","")
-
- Str=Replace(Str,","&uPic,"")
-
- sql="update Pic set listpic='"&Str"' where ID in ("&Request("pID")")"
-
- conn.execute(sql)
-
- Response.write"<script>alert('操作成功!');location.href=''</script>"
-
- Response.end