Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 19th, 2003, 03:48 PM
Registered User
Join Date: Jun 2003
Location: tempe, AZ, USA.
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>"
          '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.
    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.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 02:32 PM.

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