Forum Moderators: open

Message Too Old, No Replies

Global.ASA difficulties

         

txbakers

7:03 pm on Dec 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use this stock global.asa file to track open sessions on my application. It worked flawlessly on my old server, now my new server gives object errors on

Both are W2000AS SP3. I don't know enough about the global.asa file to trouble shoot. Can someone figure it out?

<object runat="Server" scope="Application"
id="rstActiveUsers" progid="ADODB.Recordset">
</object>

<script language="VBScript" runat="Server">
' The first thing you should notice is the top line.
' It creates an application scoped recordset object
' named rstActiveUsers that I'll use to store all
' our user information.

Sub Application_OnStart()
' Selected constants from adovbs.inc
Const adInteger = 3
Const adVarChar = 200
Const adDate = 7

' Here I set up in memory active user recordset
' by adding the fields I want to it and defining
' their data types.
rstActiveUsers.Fields.Append "id", adInteger
rstActiveUsers.Fields.Append "ip", adVarChar, 15
rstActiveUsers.Fields.Append "browser", adVarChar, 255
rstActiveUsers.Fields.Append "started", adDate

code continues..

The error looks like this:
Object required: 'rstActiveUsers'
/charms/show_users.asp, line 2

I thought that was declared in the object tag above.

bakedjake

7:22 pm on Dec 12, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



tx: Are the new and old servers running different versions of ADO?

If so, what version is the new server running?

txbakers

7:55 pm on Dec 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks bj, where do I find the ADO version?

bakedjake

10:15 pm on Dec 12, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If you have access to the registry, check the HKLM\Software\Microsoft\DataAccess key.

RossWal

10:17 pm on Dec 12, 2003 (gmt 0)

10+ Year Member



I think it's in your system directory as msado25.tlb (v2.5) or msado26.tlb (v2.6).

I wonder if you tried the standard create object syntax if that would reveal the problem? Or if you did it from an asp page instead of the global asa?

Do you have any asp pages that are successfully using ado?

txbakers

3:51 am on Dec 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, there are about 350 ASP pages using ADO without a problem.

I'll try the regular syntax instead of the object syntax. I've never seen that before. Global.asa is new to me.

Regarding the msado files, I have all four in there:

20,21,25,26

RossWal

1:49 am on Dec 14, 2003 (gmt 0)

10+ Year Member



I think BakedJake's technique for determining the version is much superior to what I posted. I didn't see his until later. But, I would also suspect that any recent version of ado would support what you're doing, thogh as BJ say's it would be interesting to know if you had switched versions.

Good Luck

txbakers

3:47 am on Dec 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, there is a difference, on my old machine I show 2.7 in the registry, and the new machine shows 2.6.2 in the registry.

Next question - where do I get the new version? I'll check with MS.

txbakers

6:29 am on Dec 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it has nothing to do with the MDAC. I installed 2.8 on the new machine and still doesn't work.

The funny thing is I use the EXACT! same global.asa file on another website on that machine and that one works.

Go figure.

So, what's up with that, eh?

bakedjake

5:18 pm on Dec 16, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Sorry to be so late in getting back... busy weekend. :)

tx - it almost sounds like the global.asa isn't firing. You have it in your application root, correct? Also, make sure the permissions are set correctly (it needs to be accessible by your IIS user, which is usually IUSR_machinename).

If all of that is correct, can you create a test.asp page and check one of the constants declared in global.asa to see if it is firing properly?