[Tex/LaTex] How to use URLs in BibTeX database when using natbib in TeX file

bibtexhyperrefnatbiburls

I will first give you the codes then I will explain my problem:

\documentclass[a4paper,10]{article}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage{hyperref}

\begin{document}
  I hereby cite \citep{Adams_2013}.

  \bibliography{article_lib}
  \bibliographystyle{agsm}
\end{document}

Here is the BibTex file entry:

@MISC{Adams_2013,
author = {W. Adams},
title = {Breaching reservoirs},
month = {June},
year = {2013},
volume = {13},
number = {6},
language = {English},
howpublished = {AfroAIDSinfo Online},
organization = {AfroAIDSinfo},
note = {Retrieved 04 June 2013},
url = {http://www.afroaidsinfo.org/MRCWeb/appmanager/mrc/afroaidsinfo;jsessionid=qS16RJ2DzhkKvPp1h1xW14gmRSysHHTFbfzhn0QSZxv251QPJGxF!404223779?_nfpb=true&_windowLabel=editorials_1_1&editorials_1_1_actionOverride=%2Fpageflows%2Feditorials%2Fbegin&editorials_1_1cm_nodepath=%2FBEA+Repository%2FArticles%2FScience%2FClinical+Science%2FAntiretroviral+therapy%2FBreaching+HIV},
journal = {AfroAIDSinfo},
timestamp = {2013.06.04}
}

When I run the following in terminal:

latex example
bibtex example
latex example
latex example

I get the following error message:

The top-level auxiliary file: example.aux

I found no \bibstyle command—while reading file example.aux

(There was one error message)

How do I solve this problem? I need to include the url. Everything was working well until I included the url in the BibTeX database. I had the bibtex entry as @ARTICLE and it worked well, minus the url. Then, I changed it to @MISC with the url and now it doesn't work.

Following the advice on here I loaded the hyperref package to enable url usage. But, it doesn't work. I wrapped the url in the bibtex file in double quotation marks, but I got the
same result.

Here is the thread whose advice I followed:
How can I use BibTeX to cite a web page?

Best Answer

the problem is with the code %2F which occurs more than once in the url.

unfortunately, \harvardurl doesn't "protect" the url code as it should, so the % is taken as a comment and latex stops reading the line when it hits the first one, so you've got a runaway argument.

a possible patch is to add \usepackage{url} and \let\harvardurl\url. and specify [breaklinks] as an option to hyperref. the result is pretty awful, but really, it's terribly hard to get good results with a url that long!