This is the code I use everything is defined:
Function CountAds(CategoryID)
count = "SELECT COUNT(*) as Total FROM Items WHERE TopicID=CategoryID"
Set rs = connect.Execute(count)
CountAds = rs.Fields("Total"
rs.Close
Set rs = Nothing
End Function
I receive the error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/campbemr/subroutines.asp, line 48
I removed the WHERE TopicID = CategoryID
and the error went away. So that tells me that I am not passing the variable into the SQL statement correctly. How is that done?
Function CountAds(CategoryID)
count = "SELECT COUNT(*) as Total FROM Items WHERE TopicID=CategoryID"
Set rs = connect.Execute(count)
CountAds = rs.Fields("Total"
rs.Close
Set rs = Nothing
End Function
I receive the error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/campbemr/subroutines.asp, line 48
I removed the WHERE TopicID = CategoryID
and the error went away. So that tells me that I am not passing the variable into the SQL statement correctly. How is that done?