c# - Check If Query Exists if Yes - Delete -
I have the following syntax to use C # to delete an access query ... but how do I check Do the query exist? DAO Database DD; DAO.D.B.E.gen. DB = new DAO.Begen (); dd = db.OpenDatabase (path); dd.QueryDefs.Delete (queryName); I also tried to do it - but it can not be assigned to 'equality' because it is a 'law group' that has received a compilation error. >
var qd = new dao .QueryDef (); If (qd.Name.Equals = "Hello") {dd.QueryDefs.Delete (queryName); }
You can loop on the QueryDefs collection and check if you get this Has been ... DAO Databases DD; DAoD.B.G.IN DB = new DAO.BEIGIN (); dd = db.OpenDatabase (path); Bull got = wrong; Forchach (dd.o.qdf qd in dd.QueryDefs) {if (qd.Name == "hello") {found = true; }} If (found) {dd.QueryDefs.Delete (queryName); }
Comments
Post a Comment