473,383 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

type mismatch and session variables

I am having a problem with a page that creates a treeview from a database,
by reloading itself on each request for a new folder to be explored.
The problem revolves around using an array to store the data, that is
copied to a session variable, and reloaded from that with each new view.
That is, on first opening the page, the array is created and populated,
then copied over; subsequent reloads of the page load the session variable,
rather than create the array. This is where the problem lies - by DIMing
the array, the first load of the page is fine, but a type mismatch pops up
when the session is pulled in to the array name; not DIMing the array, the
first load fails due to not declaring the array.

Currently the ony way I have round the problem is to switch option explicit
off and not DIM any variable. If there was a way to have the session
variable and array co-exist to start with, that would be good.

TIA
Jul 22 '05 #1
1 2479
I always bring arrays local before referencing them. This might help a
little bit (though not directly related):
http://www.aspfaq.com/2524


"s_m_b" <sm********@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
I am having a problem with a page that creates a treeview from a database,
by reloading itself on each request for a new folder to be explored.
The problem revolves around using an array to store the data, that is
copied to a session variable, and reloaded from that with each new view.
That is, on first opening the page, the array is created and populated,
then copied over; subsequent reloads of the page load the session
variable,
rather than create the array. This is where the problem lies - by DIMing
the array, the first load of the page is fine, but a type mismatch pops up
when the session is pulled in to the array name; not DIMing the array, the
first load fails due to not declaring the array.

Currently the ony way I have round the problem is to switch option
explicit
off and not DIM any variable. If there was a way to have the session
variable and array co-exist to start with, that would be good.

TIA

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Laura | last post by:
Help. Below is my code. Getting Type mismatch error on the noted line. I'm trying to send an array (aryNewD) with 4 columns and x rows to a function to save all the array info into a SQL Server...
2
by: Tom Jordan | last post by:
Hi all, I've thrown together a simple shoppng cart and basket, but I occasionally get a type mismatch error on the basket. For example: Microsoft VBScript runtime error '800a000d' Type...
3
by: Savas Ates | last post by:
i have 3 columns in sql server .. all of them are numeric value when a user enter my site i take the value of userid (numeric one) i assign it as session("userid ") after a query i take 2...
1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
0
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query...
3
by: Snow | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' The error happened at this line: if session("systemIdCount" & arrSystems(iLoop)) 0 The code like this:
5
by: daniel.hedz | last post by:
I am generating a usercontrol dynamically successfully, but when I try to find that usercontrol I get a type mismatch. This is what I am doing: //Loading my usercontrol...
19
by: Lysander | last post by:
I have written a query that takes three integers representing day,month and year, forms a date from them and compares this date to the date the record was entered and returns any records where the...
1
by: NarutoFanatic | last post by:
Hi, Im currently updating our email sending functionality of our application. The website is written in classic asp and all codes are really a mess. anyway my problem is that our current process...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.