views:

20

answers:

1

i am using excel to connect to a mysql database

i am doing this:

rs.Find "rowid='105'"
If Not rs.EOF Then cn.Execute "delete  from batchinfo where rowid='105'"

and it works well

however, i need to be able to match data on multiple columns for example like this:

rs. find "rowid='105'" and "something='sometext'" and "somethingelse='moretext'"

i need to know whether or not rs.find matched ALL of the data.

how can i do this?

according to this i can't: http://articles.techrepublic.com.com/5100-10878_11-1045830.html#

however perhaps there's a way i can rs.execute "some select statement" can someone help with this?

would this do the trick for me and then i would check EOF:

rs.Filter "LastName='Adams' and FirstName='Lamont'"
+1  A: 

Can you just do it all in SQL like :

DELETE  FROM batchinfo where rowid='105'
AND EXISTS (SELECT * FROM batchinfo WHERE rowid='105' and something='sometext' and somethingelse='moretext')
Ben Robinson
ben i dont really understand the syntax can you please explain?
I__
error: you can't specify target table batchinfo for update in from clause
I__
Why the exists bit? Why not just `DELETE FROM batchinfo where rowid='105' and something='sometext' and somethingelse='moretext'` ? The recordsaffected property can be used to check the records deleted.
Remou