Forum Moderators: open

Message Too Old, No Replies

Microsoft VBScript runtime error '800a01a8'

         

ramy

3:59 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



I get this error and can't figure out what is wrong.

Microsoft VBScript runtime error '800a01a8'

Object required: 'rs2'

/login/login.asp, line 233

I can post code later if necessary.

defanjos

4:26 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you have to set rs2
for example:
set rs2 = Server.CreateObject("ADODB.Recordset")

or you are calling rs2 after the object has been closed.

For example, you have something like:
rs2.close
set rs2=nothing

you cannot use rs2 after closing it

ramy

5:52 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



Step 1:
___________________________________________________________________________­__

SUB GetUserSecurity
DIM rs2
SET rs2 = Admin.AdminUserSecurity(varUserId, DBInstance)

IF (rs2.eof AND rs2.bof) THEN
InternalOnly = "N"
ELSE
DO UNTIL rs2.EOF
IF rs2("security_class") = "1902" Then
InternalOnly = "Y"
END IF
rs2.movenext
LOOP 'End Main Do while loop
END IF'End Main If
SET rs2 = NOTHING
END SUB

___________________________________________________________________________­____

Step 2:

Public Function GetUserSecurity(ByVal strUser As String, _
ByVal DBInstance As String) As
ADODB.Recordset
On Error GoTo errorHandler
Dim strSQL As String

strSQL = _
"Select password, internet_status_code " & _
"From internet_users " & _
"WHERE user_name = '" & strUser & "' "

Set objDB = New WVOracle_DB.CDataAccess
Set GetUserSecurity = objDB.RunSQLReturnRS(strSQL, DBInstance)
Set objDB = Nothing

'GetObjectContext.SetComplete
Exit Function

errorHandler:
Set objDB = Nothing
RaiseError_DisableCommit m_modName, "Error in WVOIC_Admin:
GetUserSecurity"
End Function
___________________________________________________________________________­_

Step 3:

Function RunSQLReturnRS(ByVal strSQL As String, _
ByVal DBInstance As String) As ADODB.Recordset
On Error GoTo errorHandler

Dim ConString As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset

ConString = GetConnectionString(DBInstance)

With rs
.ActiveConnection = ConString
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockReadOnly
.source = strSQL
.Open
Set .ActiveConnection = Nothing
End With

Set RunSQLReturnRS = rs
Set rs = Nothing

Exit Function

errorHandler:
Set rs = Nothing
RaiseError_DisableCommit m_modName, "Error in WVWorkflow_DB"
End Function
___________________________________________________________________________­___

Anyone see what is going wrong? I can't see anything wrong.

defanjos

7:10 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is line 233?

ramy

3:24 pm on Feb 16, 2007 (gmt 0)

10+ Year Member



IF (rs2.eof AND rs2.bof) THEN

defanjos

4:44 pm on Feb 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am not familiar with "Admin.AdminUserSecurity(varUserId, DBInstance)".

Your problem is probably there. The recordset is not being created.

ramy

4:48 pm on Feb 16, 2007 (gmt 0)

10+ Year Member



Public Function AdminUserSecurity(ByVal strUser As String, _
ByVal DBInstance As String) As ADODB.Recordset
On Error GoTo errorHandler
Dim strSQL As String

strSQL = _
"Select security_class " & _
"From internet_user_access " & _
"WHERE user_name = '" & strUser & "' "

Set objDB = New WVOracle_DB.CDataAccess
Set AdminUserSecurity = objDB.RunSQLReturnRS(strSQL, DBInstance)
Set objDB = Nothing

'GetObjectContext.SetComplete
Exit Function

errorHandler:
Set objDB = Nothing
DoLog (Err.description)
RaiseError_DisableCommit m_modName, "Error in WVOIC_Admin: AdminUserSecurity"
End Function

************************************************

The SQL statement returns a result