[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBScript runtime error '800a01c1'

Posted on 2002-05-27
9
Medium Priority
?
1,571 Views
Last Modified: 2012-06-27
Hey Everyone,

I am getting this error when I am trying to access a vb component.  Is it because my component is not registering properly?  Does anyone have any suggestions?

Microsoft VBScript runtime error '800a01c1'

Argument not optional: 'GenerateExcelReport'

/excelreportmts.asp, line 69
0
Comment
Question by:rickydoyle
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 7037491
it is not that the component has not been registered. Your component has been successfully registered. The method requires an additional argument e.g.
GenerateExcelReport 1
or
GenerateExcelReport "string"

You have to know what arguments are required by this method and what data type is required, be they string, boolean or numeric or others.
0
 

Author Comment

by:rickydoyle
ID: 7037498
Ok, this is what I have in my asp page where I am gettign the error

sPath =oReport.GenerateExcelReport(cStr(strmaster),cStr(strRtype))

Then within my vb class I have this code
Public Function GenerateExcelReport(Master, RType) As String

To me everything looks fine with that so that is why I am confused on this.  

0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 400 total points
ID: 7037526
Firstly,
your function shd be
Public Function GenerateExcelReport( _
ByVal Master As String, _
ByVal RType As String) As String

End Function

If you do not specify that, then the default is ByRef which may be the cause of the problem.

Check http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q197956

If you are passing by reference then, you must specify as variant

Public Function GenerateExcelReport(ByRef Master As Variant, ByRef RType As Variant) As String
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 23

Expert Comment

by:b1xml2
ID: 7037529
It may be that this may not be the cause of the problem. However, you should change your parameter types as this is considered prudent coding and unless you want to use the arguments's values which may be changed via the function, use the ByVal keyword instead.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7037533
also have a look at this

http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q244012

INFO: Type Mismatch Errors When You Pass Parameters from ASP to a Visual Basic Component (Q244012)
0
 

Author Comment

by:rickydoyle
ID: 7037599
I am unsure right now, I have looked at both articles and from the info you gave me everything looks like it should flow correctly but it is not.  I just installed IIS on my machine, would it have anything to do with settings I may have set up?
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 7038469
Does your component work outside of ASP?  Maybe something going on inside your component is throwing the error?
0
 
LVL 11

Expert Comment

by:Nitin Sontakke
ID: 7038885
This is just a random suggestion. You may NOT implement it. However, my experience with ASP / VB communication has following to share with you.

As VBScript (in which we write asp files) being a scripting language, does not support strongly typed variables, by default.

Somehow, i have never experienced problem with sending Integer as a function return value from VB to ASP. For this reason, i would recommend you to return integer value from VB function as -1 (Success) or 0 (Failure) in the function.

For returning string value to ASP, add yet another parameter ByRef.

After modifications, if you choose to do, your code will look something as follows:

VB:

Public Function GenerateExcelReport( _
ByVal Master As String, _
ByVal RType As String, _
ByRef strReturn As String) As Integer

ASP:

Dim iReturn, sPath

iReturn = oReport.GenerateExcelReport(cStr(strmaster),cStr(strRtype), sPath)

If iReturn <> 0 Then
   'Error occured in component.
End If
0
 
LVL 11

Expert Comment

by:Nitin Sontakke
ID: 7038892
Sorry, it should have been:

If iReturn = 0 Then
  'Error occured in component.
End If

You know what i am trying to say, anyway.

Also, this takes care of scenario "clockwatcher" is referring to.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

829 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