Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Issues With Server Migration

Microsoft VBScript runtime error Invalid procedure call or argument:'RIGHT'

10:58 am on Dec 10, 2007 (gmt 0)

New User

10+ Year Member

joined:Dec 10, 2007
posts: 2
votes: 0

To Explain the situation.

I currently have a schools ICT Intranet support site designed by another individual who unfortuantly no longer works for the school, we have no ASP experts here, and my knowledge is what ive picked up as ive gone along.

The site currently resides on a Windows 2003 Server Microsoft IIS, connecting to SQL Server 2000 for the database entries works ok on the current server.

Now this server is abit dated so i planned to move it all over to the new server. Nearly the same setup Server 2003, Microsoft IIS and Sql Server 2005 being the only main change.

First off i wanted to just move the Webs stuff, leave the SQL Servers in place for now and migrate them over later. However this isnt working to plan. I setup the ODBC to connect to the old server tested it all works fine from that end.

However i run the pages and goto logon i get the following error.

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'RIGHT'

/NewIndex.asp, line 20

Which looks like this Line 20 being in bold

<!--#include file="Connections/Support_Database.asp" -->

Dim MyUser
MyUser = Request.ServerVariables("AUTH_USER")
Session("SupportUser") = MyUser

DIM iMonth
iMonth = Month(now)
Session("RequestMonth") = iMonth

Dim MyEmail
Dim MyLength
MyLength = len(MyUser)
Session("Count") = (MyLength - 9)
MyLength = Session("Count")
MyEmail = RIGHT(MyUser,MyLength)
Session("SupportEmail") = MyEmail &"@domain.domain.sch.uk"

Dim MyDate
MyDate = Date()
Session("SupportDate") = MyDate

Dim MyTime
MyTime = Time()
Session("SupportTime") = MyTime

Dim Users__MMColParam
Users__MMColParam = "1"
If (Session("SupportUser") <> "") Then
Users__MMColParam = Session("SupportUser")
End If

Dim Users
Dim Users_numRows
Dim CurrentUser

Set Users = Server.CreateObject("ADODB.Recordset")
Users.ActiveConnection = MM_Support_Database_STRING
Users.Source = "SELECT * FROM dbo.Users WHERE Username = '" + Replace(UCASE(Users__MMColParam), "'", "''") + "'"
'Users.Source = "SELECT * FROM dbo.Users"
Users.CursorType = 0
Users.CursorLocation = 2
Users.LockType = 1

If Not Users.EOF Then
' User has associated record in database

' User is not known - redirect to help page
'Response.Write "Bad"
End If

'Users_NumRows = 0

'Do While Not Users.EOF
'Users_NumRows = Users_NumRows + 1
'If Users_NumRows = 0 Then Response.Write ("You are not known in the database")
'If Users_NumRows = 1 Then
'Response.Write ("You ARE known in the database")
'End If
'If Users_NumRows > 1 Then Response.Write ("Error : To many records returned")


<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


Set Users = Nothing

Now ive looked up this and it refers to Null database entries but i cant see how this is relivant as it currently works on currently live old server! only thing i can think of is that its not pickign up the info off the sql server but im lost! any help would be great.

8:27 pm on Dec 10, 2007 (gmt 0)


WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
votes: 3

Just my two second look.

My first assumption is that Request.ServerVariables("AUTH_USER") is returning a empty or null value, and causing the issues you described. I think you didn't setup the authentication the same way it was setup on the old server which is what is causing your problem.

MyUser = Request.ServerVariables("AUTH_USER")
MyLength = len(MyUser)
MyEmail = RIGHT(MyUser,MyLength)

The Right function requires MyLength variable to be positive integer greater then zero.

Related Links:

Visual Basic Scripting Edition:
Right Function [msdn2.microsoft.com]

IIS Server Variables:
AUTH_USER [msdn2.microsoft.com]

The name of the user as it is derived from the authorization header sent by the client, before the user name is mapped to a Windows account. This variable is no different from REMOTE_USER. If you have an authentication filter installed on your Web server that maps incoming users to accounts, use LOGON_USER to view the mapped user name.

[edited by: Ocean10000 at 8:28 pm (utc) on Dec. 10, 2007]

8:00 am on Dec 11, 2007 (gmt 0)

New User

10+ Year Member

joined:Dec 10, 2007
posts: 2
votes: 0


Id gone though the ISS Settings time after time after time and thought they were exact, 1 tick box! just had to disable the Anonymous access and jobs done Thank you very much for the help i owe you a drink!


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members