Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2003, 03:51 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default runtime error '800a01a8' Object Required: 'Session

I'm at my wits end...I have a function that works fine on my Production server, but I can't get to work on my test server. Everything I've found on the runtime error '800a01a8' points to not having IIS Virtual directory application created, but it is.
Here's the code:
Function Authenticate (strUserID)
    Dim SQLString,DatabaseConnection,UserRecordset,objUser ID,objLevel

    'Create a database connection object. Then open the database.
    Set DatabaseConnection = Server.CreateObject("ADODB.Connection")
    DatabaseConnection.Open "FILEDSN=my.dsn;UID=;PWD="
    'Create a record set object.
    Set UserRecordset = Server.CreateObject("ADODB.Recordset")

    SQLString = "SELECT CPMS_UserName, Access_type FROM CPMS_Users_table WHERE (CPMS_UserName = '" & strUserID & "')"

    'Run the SQL query.
    UserRecordset.Open SQLString, DatabaseConnection
    'Test to see if no records match the query. If none do, print a message.
    If UserRecordset.EOF Then
        Response.Write "<P><B>I'm sorry, but you are not authorized to use this application.</B></P>"
        Session.Abandon
passthru=false
    Else
         'Put the results of the query into variables.

'**the next two commented lines are the ones that work on production server
         'Set Session("objUserID") = UserRecordset("CPMS_UserName")
         'Set Session("objLevel") = UserRecordset("Access_type")
         Set Session("objUserID") = UserRecordset.Fields.Item("CPMS_UserName").Value
         Set Session("objLevel") = UserRecordset.Fields.Item("Access_type").Value

passthru = true
         'Response.Write Session("objUserID")
         'Response.Write Session("objLevel")

    End If

    'Close the database.
    DatabaseConnection.Close
    Set DatabaseConnection = Nothing
    Exit Function

End Function

Note: see my note above '**
If I uncomment those two lines I lose the session after the database close, but again these lines work fine in production.

Any help is much appreciated.


Mrs.Footohi
 
Old July 17th, 2003, 06:32 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I removed the word 'Set' and that worked on my Test server.

Mrs.Footohi





Similar Threads
Thread Thread Starter Forum Replies Last Post
VBScript runtime error '800a01a8' - FIXED buddyz Classic ASP Databases 2 September 13th, 2006 10:55 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Basics 1 July 21st, 2006 11:43 AM
Microsoft VBScript runtime error '800a01a8' Abbas Classic ASP Professional 1 July 21st, 2006 11:42 AM
Microsoft VBScript runtime error '800a01a8' object stevesole Access ASP 9 June 7th, 2004 08:13 PM
Microsoft VBScript runtime error '800a01a8' gmoney060 BOOK: Beginning ASP 3.0 1 June 2nd, 2004 01:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.