Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. 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 Professional 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:48 PM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Object required jpaul VB Databases Basics 5 November 14th, 2007 12:10 PM
object required alitoday Classic ASP Components 1 December 28th, 2004 01:17 AM
object required shoakat Classic ASP Databases 7 November 23rd, 2004 07:38 PM
runtime error '800a01a8' Object Required: 'Session footohi Classic ASP Basics 1 July 17th, 2003 06:32 PM





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