Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Passing an Array from ASP to VB DLL

Posted on 2000-03-20
2
Medium Priority
?
392 Views
Last Modified: 2012-08-13
Hi

I have a VB DLL and in that I have a function called savedata(InputArr as variant) as integer

I am doing some manipulations of the array elements there and after that I have to insert the data in to the database.

I am populating that Array in an ASP page. I want to pass the entire array from ASP page to the VB DLL. The code in ASP page looks like this:

dim objhelper
set objHelper=server.CreateObject("HelperObject.Helper")

if isobject(objhelper) then

 if objhelper.SaveData(DLLARR) = -1 then
      
            Response.Write("fail")
      else
            Response.Write("Success")
      end if      
 end if

It is creating the object. But it is giving an error like

Invalid procedure call or argument error '800a0005'
Invalid procedure call or argument

/tradecom/members/newaccount/create_fldsArray.asp, line 88


It is giving error in yh eline "if objhelper.SaveData(DLLARR) = -1 then".

DLLARR is my array.


Hope somebody can give me some hints.

Thanks
RR
0
Comment
Question by:r_nair
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
tamirp earned 100 total points
ID: 2636454
ID: Q217114,Q174576,Q244012 all arrays to the VB must be Variant by type and passed by reference.
so you would declare the helperobject procedure as:
Public Function savedata(ByRef InputArr as variant) as integer.

yours,
Tamir
some examples:

URLS:
http://support.microsoft.com/support/kb/articles/Q217/1/14.ASP
http://support.microsoft.com/support/kb/articles/Q244/0/12.ASP
http://support.microsoft.com/support/kb/articles/Q174/5/76.ASP

0
 

Expert Comment

by:Tension
ID: 2677177

  Try out this r nair...

Sample Code
~~~~~~~~~~~

 Try out this r_nair ...

ASP Code
~~~~~~~~

dim objhelper
set objHelper=server.CreateObject("HelperObject.Helper")

Dim temparr(5)
temparr(0) = "x"
z = x.Arr(temparr)

VB Dll Code
~~~~~~~~~~~

Public Sub Arr(x As Variant)

Dim z()
z = x

MsgBox z(0)
MsgBox UBound(x)

End Sub
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question