By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

Unable delete the data if it has space in between

kirubagari
100+
P: 158
Hi Experts,
If i want to delete a data ,lets say RayMond Roy the code that i developed have bugs to delete that.Without space i can able to delete without any problem.Please help

Expand|Select|Wrap|Line Numbers
  1.       response.write "<td align=center><img border=0 src=images/delete.gif alt=Delete onmouseover=this.style.cursor='hand' onmouseout=this.style.cursor='default' onclick=getcell('d','" & rsct("ID") & "','" & rsct("VALUE") & "');>"
  2.  
  3.  
  4. if operation = "d" then
  5.           cn.execute("delete from table where ID = " & detail) %>
  6.             <script languange="javascript">
  7.             document.operation.submit();
  8.         </script>    <%
  9. end if
Aug 16 '12 #1
Share this Question
Share on Google+
5 Replies


ariful alam
100+
P: 185
you should use (') single quote in both side of variable details like
Expand|Select|Wrap|Line Numbers
  1. cn.execute("delete from table where ID = '" & detail & "'") %>
Hope works for you. :)
Aug 16 '12 #2

PsychoCoder
Expert Mod 100+
P: 465
You dont need 's if the variable type is integer
Aug 17 '12 #3

debasisdas
Expert 5K+
P: 8,127
As already suggested use single quotes on both the sides and trim the values before assigning to the variable if the variable is a string type. If it is a number type, you will not have any issue.
Aug 17 '12 #4

kirubagari
100+
P: 158
Hi All,

Still having issue.
Please help.Unable delete the data.The data type is Varchar
Aug 17 '12 #5

Rabbit
Expert Mod 10K+
P: 12,369
Use the single quotes as suggested. If you are still having a problem, you need to show us the new code.
Aug 17 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.