While passing variables as an URL's querystring, you should need to encode the string. All special characters like space must be written in adress bar in a form for browser.
Without encoding Example :
<a href="search.asp?query=all news in 2006">List all news in 2006</a>
If you try this link, there would be some missing queries in your SQL command. But if prefer to use URL Encode function, all querystring will be encoded in a safe mode.
Encode Example :
<a href="search.asp?query=<%Server.URLEncode("all news in 2006")%>">List all news in 2006</a>