Forum Moderators: open

Message Too Old, No Replies

Microsoft VBScript runtime error '800a01a8'

         

prashanttalwar

11:13 am on Oct 10, 2004 (gmt 0)



i cant get the following piece of code to work, its an include file. Internet explorer gives the following error:
Microsoft VBScript runtime error '800a01a8'

Object required: ''

/MR/include/config.inc, line 7

here is the code, can someone help?

<%
Option Explicit

Dim Session

'Set Unicode for Arabic
Session.CodePage=65001

Dim databasePath'Set this to the location of the database
Dim databaseUserName 'line9
Dim databasePassword

Dim vbTextCompare

vbTextCompare = 1

'First get the pass from the auth database
'Dim authCon
'Dim authRset
'Dim authDBPath
'Dim authDBPassword
'Dim authSql
'authDBPath = Server.MapPath("auth.mdb")
'authDBPassword = "kpmg"
'Set authCon = Server.CreateObject("ADODB.Connection")
'Set authRset = Server.CreateObject("ADODB.Recordset")
'authCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & authDBPath & ";JET OLEDB:Database password=" & authDBPassword
'authSql = "SELECT * FROM Auth WHERE Username = 'Admin'"

'Open the recordset with the SQL query
'authRset.Open authSql, authCon

'If (authRset.BOF AND authRset.EOF) Then
'Response.Write("Critical Error")
'Else
'databasePassword = authRset("Password")
'End If
'authRset.Close
'Set authRset = Nothing
'Set authCon = Nothing

'init database stuff

databasePath = Server.MapPath("data.mdb")
databaseUserName = "Admin"
databasePassword = "kpmg"

Dim adoCon 'Holds the Database Connection Object
Dim rsMRL'Holds the recordset for the records in the database
Dim strSQL'Holds the SQL query for the database

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Create an ADO recordset object
Set rsMRL = Server.CreateObject("ADODB.Recordset")

'set read/write
'adoCon.Mode = &H10
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & databasePath & ";JET OLEDB:Database password=" & databasePassword

'Set an active connection to the Connection object (DSN-less connection)
'adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};uid=" & databaseUserName & ";pwd="& databasePassword & ";DBQ=" & databasePath & ";"

'Set an active connection to the Connection object (DSN connection)
'adoCon.Open "DSN=data"

'Highlighting Functions

Function regexReplacer(strInput, strSearch)
Dim REO
Set REO = New RegExp
With REO
.Pattern = strSearch
.IgnoreCase = True
.Global = True
End With

regexReplacer = REO.Replace(strInput, "<b>"& strSearch & "</b>")
Set REO = nothing

End Function

Function replacer(strInput, strSearch)
replacer = Replace(strInput,strSearch,"<span style=""background-color:#E7EAF0;""><b>" & strSearch & "</b></span>", 1, -1, vbTextCompare )
End Function

Function manualReplacer(strInput, strSearch)
Dim istart
Dim iend
Dim icur
Dim strOutput
dim intLen

strOutput = strInput
intLen = Len(strSearch)

icur = 1
istart = InStr(icur, strOutput, strSearch, 1)
Do While istart
strOutput = Left(strOutput, istart - 1) & "FOUND IT FOUND" & Mid(strOutput, istart, intLen) & "END FOUND! LSKJFdsF"& Mid(strOutput, istart + intLen)
icur = istart + intLen + 7
istart = InStr(icur, strOutput, strSearch, 1)
Loop

manualReplacer = strOutput
End Function

%>

MozMan

4:34 pm on Oct 11, 2004 (gmt 0)

10+ Year Member



It looks like you're actually throwing the error on this line:

Session.CodePage=65001

I've never seen anyone DIM the Session before. Try commenting out this line (4):

Dim Session

and that might do the trick for you. By issuing the DIM command, but never SETting it to an object, the ASP engine doesn't know what to do with .CodePage, because it doesn't know Session is an object. The session object should be inherent (from the global.asa) and not need to be declared on this page.

-Moz.