473,942 Members | 14,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(vAr rayItem)

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

'See if it is a replacement variable and exists in the dictionary
if left(vArrayItem (count),6) = "tkRep_" and
p_ReplaceVars.e xists(vArrayIte m(count)) then
' then replace it
Error occurs here >> vArrayItem(coun t) =
p_ReplaceVars.I tem(cstr(vArray Item(count)))
end if
next

dim vArrayItemNew
vArrayItemNew = ""

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

if vArrayItem(coun t) = ubound(vArrayIt em) then
vArrayItemNew = vArrayItemNew & vArrayItem(coun t)
else
vArrayItemNew = vArrayItemNew & vArrayItem(coun t) & " "
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\DO C_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 5323
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**********@h otmail.com> wrote in message
news:e8******** *************** **@posting.goog le.com...

ADODB.Field (0x800A0D5C)
Object is no longer valid.
D:\WWW\LCDEV\DO C_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******* *******@TK2MSFT NGP12.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**********@h otmail.com> wrote in message
news:e8******** *************** **@posting.goog le.com...

ADODB.Field (0x800A0D5C)
Object is no longer valid.
D:\WWW\LCDEV\DO C_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
16852
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 Class
2
2218
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 vdicReplaceVars) set p_ReplaceVars = vdicReplaceVars End Property Private p_ReplaceVars
4
2751
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 also supported per the SOAP Spec, and from what I understand, .NET's implementation of WebServices, donot follow the standard, but instead shimmy this behavior by working with a strict request/response WSDL. So my question is - If I mark an int...
3
6628
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 ByVal and modify it, the original string doesn't change. If I pass it ByRef it does. This makes it seem like the actual type (reference or value) that is being passed is irrelevant and that only the ByVal or ByRef keyword matters. Is this...
2
4166
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 Dim ExistingTolerances() As Double 'oSurfBody is declared and assigned in the following Call oSurfBody.GetExistingFacetTolerances(ToleranceCount, ExistingTolerances)
4
1687
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
10281
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 application. The sub loadValueByVal takes the argument by value so after returning to calling method, the object should be unchanged but it is not Public Class ITest Private MyName As String Public TestId As String Public Sub New()
11
8157
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 number) which is the last line of the following sub routine: ' procedure modifies elements of array and assigns ' new reference (note ByVal) Sub FirstDouble(ByVal array As Integer()) Dim i As Integer
0
1541
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 module as an argument to one of the .NET DLL method. Step by step, here's what i am doing: 1. Create vba class module in MS ACCESS Option Compare Database Option Explicit ... Public Function DoSomething(ByVal S as String, ByRef RetVal as...
0
11531
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11298
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4909
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.