Solved

Passing an Array from ASP to VB DLL

Posted on 2000-03-20
2
387 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
2 Comments
 

Accepted Solution

by:
tamirp earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now