This is a question about my SQL statement on an asp page. The page is a detail page which a user arrives at when they have searched the database and chosen a specific match from the results list. The detail page needs to pull data from two separate tables in the database. There is one field common to both tables and so I am using that to do the join. However, I get an error when clicking on the link from the results page, trying to reach the detail page:

Request object error 'ASP 0102 : 80004005'
Expecting string input
The function expects a string as input.

Any ideas what this means? The field I am passing as a URL parameter is a numeric field (AdNum). I tried changing it to text but that did not make a difference.

Here's the code for the SQL statement:
Dim rsDetail__varAdNum
set rsDetail = Server.CreateObject("ADODB.Recordset")
rsDetail.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\Sullivan\BrettKnowles_com\web\database\Properties.mdb"
rsDetail.Source = "SELECT PropertiesFull.*, Photos.Photo1, Photos.Photo2, Photos.Photo3, Photos.Photo4, Photos.Photo5 FROM PropertiesFull, Photos WHERE Photos.AdNum = PropertiesFull.AdNum AND PropertiesFull.AdNum = " + Replace(rsDetail__varAdNum, "'", "''") + ""
rsDetail.CursorType = 0
rsDetail.CursorLocation = 2
rsDetail.LockType = 3
rsDetail_numRows = 0

Any suggestions? I'm lost! Why does the detail page not recognize the variable I am passing to it from the results page?