Anyone have a clue what I am doing wrong here?
I have tried to call this function a bunch of different ways, but here is the latest:
mProfitPercent = GetProfitPercent
Here is the function that I am trying to call:
Function GetProfitPercent
Dim rsRegx
Set rsRegx = Nothing
'Set rsReg = ActiveConnection
sSQL="SELECT PROFIT_PERCENT FROM t_DIRECTORY WHERE directory_id = '" & Session("UserLocationId") & "'"
set rsRegx = server.CreateObject("adodb.recordset")
rsRegx.cursorlocation = aduseclient
rsRegx.cursortype = adkeyset
rsRegx.open sSQL, gobjConnect
if not rsRegx.eof then
Session("PPercent") = rsRegx("PROFIT_PERCENT") & ""
else
Session("PPercent") = ".15"
end if
rsRegx.Close
Set rsRegx = Nothing
CloseDbConn
End Function
Here is the exact error I am getting:
Microsoft VBScript runtime error '800a01a8'
Object required
It errors on an Execute statement...
Thanks!