Below is a function, where abouts in my ASP script do i declare the variable sSQLCount ie within the function or at the top of my script?
Function CountFAQ(CategoryID)
sSQLCount = "SELECT Count(*) From tblFAQ Where CategoryID =" & CategoryID & " AND Active='Y'"
Set oRecordsetCount = Server.CreateObject("ADODB.Recordset")
oRecordsetCount.Open sSQLCount, oConnection
oRecordsetCount.MoveFirst
NumberFAQ = oRecordsetCount(0)
CountFAQ = NumberFAQ
oRecordsetCount.Close
Set oRecordsetCount=Nothing
End Function
Function CountFAQ(CategoryID)
sSQLCount = "SELECT Count(*) From tblFAQ Where CategoryID =" & CategoryID & " AND Active='Y'"
Set oRecordsetCount = Server.CreateObject("ADODB.Recordset")
oRecordsetCount.Open sSQLCount, oConnection
oRecordsetCount.MoveFirst
NumberFAQ = oRecordsetCount(0)
CountFAQ = NumberFAQ
oRecordsetCount.Close
Set oRecordsetCount=Nothing
End Function