Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Object in Other Database

Status
Not open for further replies.

Chopper

Programmer
May 30, 2000
59
US
Does anyone know how to delete an object in another database?&nbsp;&nbsp;i.e. Delete a report in DatabaseB.mdb from DatabaseA.mdb<br><br>I have looked for some time for the solution and have had no success.&nbsp;&nbsp;<br><br>Thanks in advance, <br>Chopper<br><br><A HREF="mailto:kenneth.mai@exch.compass-usa.com">kenneth.mai@exch.compass-usa.com</A>
 
Some of the tools, such as the performance wizard, do modify other databases, but the effects all seem to take the form of adding objects.&nbsp;&nbsp;Deleting an object requires exclusive access to the object which is tough to guarantee remotely.&nbsp;&nbsp;In addition, forbidding remote deletes adds a certain amount of safety.&nbsp;&nbsp;That is, in order to delete an object you must first open the database.<br><br>I don't know for sure, but I suspect that what your're trying to do just isn't possible in any reasonable manner.<br><br>IF you are truly desperate and willing to try an unreasonable approach you might try to follow the somewhat Rube Goldberg outline:<br><br>(1) Write a procedure which deletes the object named in the /CMD (name?) parameter of the MS Access command line, doing nothing if the line is the empty string.&nbsp;&nbsp;It might be a good idea to ask first.&nbsp;&nbsp;I think the parameter is accessible through the Command function.&nbsp;&nbsp;Pair it with an AutoExec macro that calls the procedure and incorporate both in each database which may have to be remote deleted.<br><br>(2) Obtain the ExeCmd procedure from the Microsoft Knowledge base.&nbsp;&nbsp;Convert it to a working procedure and include it in the database which needs to trigger the delete.<br><br>(3) A call such as<br><br>ExeCmd &quot;MSACCESS C:\Databases\Target /EXCL /CMD table-gone&quot;<br><br>might work.&nbsp;&nbsp;Of course the format of the /CMD parameter would depend on the functionality and parse in the delete function you write.<br><br>Again, this comes with no guarantee, is a lot of work, may not be exactly what you want and is dangerous too.&nbsp;&nbsp;&nbsp;Odds are you're just better off opening another database once in a while.<br><br>Best,<br><br>Harry Rich<br><br>&nbsp;<br><br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top