Solved

Passing an Array from ASP to VB DLL

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordpress display sub menu only when click 12 100
ASP server side get value 15 50
Multiflying 2 Input Text On a Table 7 36
Making Table Thru ASP Response.write 5 38
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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