473,322 Members | 1,493 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,322 software developers and data experts.

Passing Dictionary object byref

Passing Dictionary object byref

Ive created an ASP class that uses a dictionary object which is filled
from a recordset. It passes the object to the propterty of another ASP
class byref:

Public Property Let dicReplaceVars(byref vdicReplaceVars)
set p_ReplaceVars = vdicReplaceVars
End Property
Private p_ReplaceVars
where it is used in this other class a few times to replace values in
an array:

Function ReplaceVars(vArrayItem)

' turn it into an array split at spaces
vArrayItem = split(vArrayItem," ")
' loop through the array
for count = lbound(vArrayItem) to ubound(vArrayItem)

'See if it is a replacement variable and exists in the dictionary
if left(vArrayItem(count),6) = "tkRep_" and
p_ReplaceVars.exists(vArrayItem(count)) then
' then replace it
Error occurs here >> vArrayItem(count) =
p_ReplaceVars.Item(cstr(vArrayItem(count)))
end if
next

dim vArrayItemNew
vArrayItemNew = ""

' Loop through the array and put it back together
for count = lbound(vArrayItem) to ubound(vArrayItem)

if vArrayItem(count) = ubound(vArrayItem) then
vArrayItemNew = vArrayItemNew & vArrayItem(count)
else
vArrayItemNew = vArrayItemNew & vArrayItem(count) & " "
end if
next

' return the vArrayItemNew to the function
ReplaceVars = vArrayItemNew
End Function

The error message I get is:

ADODB.Field (0x800A0D5C)
Object is no longer valid.
D:\WWW\LCDEV\DOC_FUNCTIONS\../classes/classlcDocTKit_item.asp, line 52

However I have no idea why, it is a dictionary object and not a
recordset, the object should still be open.

Any help is greatly appreciated.

Thanks
Jul 19 '05 #1
2 5274
Are you looking at the right line in the right page? Like, is
classlcDocTKit_item.asp an include file perhaps, and you're looking at line
52 in the page with the include directive instead?

Ray at work

"Ryan Malone" <ry**********@hotmail.com> wrote in message
news:e8*************************@posting.google.co m...

ADODB.Field (0x800A0D5C)
Object is no longer valid.
D:\WWW\LCDEV\DOC_FUNCTIONS\../classes/classlcDocTKit_item.asp, line 52

However I have no idea why, it is a dictionary object and not a
recordset, the object should still be open.

Any help is greatly appreciated.

Thanks

Jul 19 '05 #2
Hi Ray

Thanks for the reply, the code that ive included is from
classlcDocTKit_item.asp. It has got me completely stumped.

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:<eP**************@TK2MSFTNGP12.phx.gbl>...
Are you looking at the right line in the right page? Like, is
classlcDocTKit_item.asp an include file perhaps, and you're looking at line
52 in the page with the include directive instead?

Ray at work

"Ryan Malone" <ry**********@hotmail.com> wrote in message
news:e8*************************@posting.google.co m...

ADODB.Field (0x800A0D5C)
Object is no longer valid.
D:\WWW\LCDEV\DOC_FUNCTIONS\../classes/classlcDocTKit_item.asp, line 52

However I have no idea why, it is a dictionary object and not a
recordset, the object should still be open.

Any help is greatly appreciated.

Thanks

Jul 19 '05 #3

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

Similar topics

3
by: Andy Read | last post by:
Dear all, I thought I understood passing parameters ByVal and ByRef but I clearly don't! If I define a simple class of: Public Class Person Public Name as String Public Age as Integer End...
2
by: | last post by:
Ive created an ASP class that uses a dictionary object which is filled from a recordset. It passes the object to the propterty of another ASP class byref: Public Property Let dicReplaceVars(byref...
4
by: Sahil Malik [MVP] | last post by:
Okay so now I understand (surprised though) - that WebServices can indeed pass ByRef/ref parameters. All I have to do is mark an integer parameter of a WebMethod as "ref". Funnily enough, this is...
3
by: Scott M. | last post by:
If I pass a reference type ByVal, am I making a copy of the object on the heap or am I making a copy of a pointer to the object on the heap? If I pass a string object (reference type) into a sub...
2
by: Neil Munro | last post by:
I'm having some "type" difficulty in passing a .NET array (byref) to a COM based API (Autodesk Inventor). In VB6 the code to return an array of tolerance values is: Dim ToleranceCount As Long...
4
by: Erik Foreman | last post by:
this is what I have 'variables defined as arrays Dim ceday(), ceti(), ceto(), ceproj(), cenotes() As String Dim cerow As Int32
2
by: Witold Iwaniec via .NET 247 | last post by:
It seems that when you pass an object to a function it is always passed by reference even if it is explicitly declared ByVal. Is it the behavior of VB.Net? Here is sample code from sample Asp.Net...
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
0
by: VaBa | last post by:
Hi, Need some help.. I have a VBA class module in MS ACCESS. In the same MS ACCESS app, I am calling a .NET DLL (which i have exposed as COM-visible) and passing BYREF an instance of the VBA class...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.