Exhibit 5.1 [LETTERHEAD OF MCKESSON] January 12, 1999 McKesson HBOC, Inc. McKesson Plaza One Post Street San Francisco, California 94104 Re: McKesson HBOC, Inc. -- Registration Statement on Form S-8 ----------------------------------------------------------- Ladies and Gentlemen: I am Senior Vice President and General Counsel of McKesson HBOC, Inc., a Delaware corporation (the "Company"), and am issuing this opinion in connection with the Registration Statement on Form S-8 being filed by the Company with the Securities and Exchange Commission (the "Commission") on the date hereof (the "Registration Statement") for the purpose of registering with the Commission under the Securities Act of 1933, as amended (the "Securities Act"), 10,597,085 shares (the "Shares") of common stock of the Company, par value $0.01 per share, to be issued by the Company upon exercise of options to be granted or stock to be sold pursuant to the stock option plans and employee stock purchase plans (the "Plans") to be assumed pursuant to the Agreement and Plan of Merger, dated as of October 17, 1998, as amended as of November 9, 1998 and as further amended as of January 12, 1999 (the "Merger Agreement"), by and among McKesson Corporation, McKesson Merger Sub, Inc., a Delaware corporation and a wholly owned subsidiary of the Company ("Merger Sub"), and HBO & Company, a Delaware corporation ("HBOC"), which Plans are set forth on the cover page of the Registration Statement. In this connection, I have reviewed the Registration Statement, as proposed to be filed with the Commission. As General Counsel, I am familiar with the Restated Certificate of Incorporation of the Company, as amended, and the Restated Bylaws of the Company, as amended, each as currently in effect. I have also examined originals or copies, certified or otherwise identified to my satisfaction of such records of the Company and such instruments, certificates of public officials, and such other documents, certificates and records as I have deemed necessary or appropriate as a basis for the opinion set forth herein. In my examination, I have assumed the genuineness of all signatures, the legal capacity of natural persons, the authenticity of all documents submitted to me as originals, the conformity to original documents of all documents submitted to me as certified, conformed or photostatic copies and the authenticity of the originals of such copies. In making my examination of documents executed or to be executed by parties other than the Company, I have assumed that such parties had or will have the power, corporate or other, to enter into and perform all obligations thereunder and have also assumed the due authorization by all requisite action, corporate or other, and execution and delivery by such parties and the validity and binding effect thereof. As to any facts material to the opinion expressed herein which I have not independently established or verified, I have relied upon statements and representations of other officers and representatives of the Company and others. I am admitted to the Bar of the State of California and do not purport to be an expert on, or express any opinion concerning, any law other than the substantive law of the State of California. Based upon and subject to the foregoing, I am of the opinion that the Shares, when issued and sold in accordance with the terms of the respective Plan to which they relate, will be legally issued, fully paid and nonassessable. I hereby consent to the filing of this opinion as an exhibit to the Registration Statement. This opinion is furnished by me, as counsel to the Company, in accordance with the requirements of Item 601(b)(5) of Regulation S-K under the Securities Act and, except as provided in the immediately preceding paragraph, is not to be used, circulated or quoted for any other purpose or otherwise referred to or relied upon by any other person without the express written permission of the Company. Very truly yours, /s/ Ivan D. Meyerson ---------------------------------- Ivan D. Meyerson