Boards.ie uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Click here to find out more x
Post Reply  
 
Thread Tools Search this Thread
17-09-2007, 11:40   #1
The Mighty Dubs
Registered User
 
Join Date: Nov 2005
Posts: 221
Type Mismatch Error...HELP!!!!!!!!

Hi All,

Im receiving the following error and am in urgent need to get rid of it. I have tried everything and think it maybe down to my regional settings. Its an ASP driven site and I have it on a test server and an actual server. Its working perfectly on the test server but not on the live server. the mismatch refers to an array being generated. I have matched the settings on both servers and Regional Settings in the control panel. Is there anywhere else i need to change to get them identical?


Microsoft VBScript runtime error '800a000d'

Type mismatch: 'arCartDesc'

/sqs/uk/functionsuk.asp, line 622
The Mighty Dubs is offline  
Advertisement
17-09-2007, 12:33   #2
DJB
Registered User
 
DJB's Avatar
 
Join Date: Apr 2002
Location: Dublin
Posts: 680
Send a message via MSN to DJB Send a message via Skype™ to DJB
what happens on line 622? post up that line of code. It's most likely you are trying to do a calculation on a string or something like that.
DJB is offline  
17-09-2007, 12:44   #3
The Mighty Dubs
Registered User
 
Join Date: Nov 2005
Posts: 221
I have highlighted in Red line 622

Function getCartInfo (InfoName)
' returns array offset for a given Cart piece of info
' returns -1 if not found
dim iPosition
dim iLoop

arCartDesc = Session("soCartDescription")
iLoop = 0
iPosition = -2

do while iPosition = -2
if iLoop <= 18 then if arCartDesc(iLoop) = InfoName then
iPosition = iLoop
end if
iLoop = iLoop + 1
else
' no item - return error
iPosition = -1
end if
Loop
getCartInfo = iPosition

End Function
The Mighty Dubs is offline  
17-09-2007, 12:53   #4
DJB
Registered User
 
DJB's Avatar
 
Join Date: Apr 2002
Location: Dublin
Posts: 680
Send a message via MSN to DJB Send a message via Skype™ to DJB
you haven't made arCartDesc an array. You need to split it with a delimiter, e.g.

arCartDesc = Split(Session("soCartDescription"),",")

where "," indicates the delimiter.

I think! Try and let me know.
DJB is offline  
17-09-2007, 13:35   #5
The Mighty Dubs
Registered User
 
Join Date: Nov 2005
Posts: 221
Ok, cheers for that. Made that change and am getting a different error now. The errors related to the light highlighted

Microsoft VBScript runtime error '800a0009'

Subscript out of range: 'iLoop'

/sqs/ie/functions.asp, line 516


Function getCartInfo (InfoName)
' returns array offset for a given Cart piece of info
' returns -1 if not found
dim iPosition
dim iLoop

arCartDesc = Split(Session("soCartDescription"),",")
iLoop = 0
iPosition = -2

do while iPosition = -2
if iLoop <= 18 then
if arCartDesc(iLoop) = InfoName then
iPosition = iLoop
end if
iLoop = iLoop + 1
else
' no item - return error
iPosition = -1
end if
Loop
getCartInfo = iPosition

End Function
The Mighty Dubs is offline  
Advertisement
17-09-2007, 13:45   #6
DJB
Registered User
 
DJB's Avatar
 
Join Date: Apr 2002
Location: Dublin
Posts: 680
Send a message via MSN to DJB Send a message via Skype™ to DJB
That error means that, for example, you are looking for the 19th item in the array and you only have 18.

Best thing to do is put this just after your dim iLoop:

response.write Session("soCartDescription")
response.end

Copy and paste what is outputted so I can see what data you are playing with.
DJB is offline  
17-09-2007, 13:53   #7
The Mighty Dubs
Registered User
 
Join Date: Nov 2005
Posts: 221
That actually brought back a blank page. This is how i coded it. Did i d it wrong?

Function getCartInfo (InfoName)
' returns array offset for a given Cart piece of info
' returns -1 if not found
dim iPosition
dim iLoop

response.write Session("soCartDescription")
response.end

arCartDesc = Split(Session("soCartDescription"),",")
iLoop = 0
iPosition = -2

do while iPosition = -2
if iLoop <= 18 then
if arCartDesc(iLoop) = InfoName then
iPosition = iLoop
end if
iLoop = iLoop + 1
else
' no item - return error
iPosition = -1
end if
Loop
getCartInfo = iPosition

End Function
The Mighty Dubs is offline  
18-09-2007, 08:41   #8
DJB
Registered User
 
DJB's Avatar
 
Join Date: Apr 2002
Location: Dublin
Posts: 680
Send a message via MSN to DJB Send a message via Skype™ to DJB
No you didn't. There was nothing in Session("soCartDescription"). This is where your problem lies. How is that value populated? Is this code you wrote yourself or off the shelf software?
DJB is offline  
18-09-2007, 13:40   #9
amen
Registered User
 
Join Date: Oct 1999
Location: Galway
Posts: 2,434
as this is server side you could debug it and inspect the variables
amen is offline  
Post Reply

Quick Reply
Message:
Remove Text Formatting
Bold
Italic
Underline

Insert Image
Wrap [QUOTE] tags around selected text
 
Decrease Size
Increase Size
Please sign up or log in to join the discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Share Tweet