There's a MS Access table which look like following.
column1 column2
---------------------------------
prod1 food
prod2 food
prod3 apparel
serv1 insurance
serv2 insurance
serv3 nailshop
---------------------------------
I want to delete record of which column1 has "proc" and column2 is "food"
If I run SQL in the MS Access's SQL view with following SQL statement, corresponding records are deleted.
Code:
DELETE FROM mytable WHERE column1 LIKE 'prod*' AND column2 LIKE 'food'
However, if I run it in my VB6 code like following, those records are not deleted.
Code:
cn.Open strConnectionstring
cn.Execute "DELETE FROM mytable WHERE column1 LIKE 'prod*' AND column2 LIKE 'food'"
cn.Close
I don't know why this happen.
I'm wondering if anybody can give me some advice.
Thanks in advance.