Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Consuming Web Service from Access VBA (Type MisMatch Error)

Discussion in 'Information Technology' started by Ayoa, Jul 28, 2006.

  1. Ayoa

    Ayoa
    Expand Collapse
    Guest

    I am attempting to call a web service from Access 2003 (using the built-in
    web services reference tool). The web service should return an array of
    integers.

    Example web method (C#)

    [WebMethod]
    public int[] GetIntArray()
    {
    int[] a = new int[5];
    for (int i = 0; i < 5; i++)
    a = i * 10;
    return a;
    }

    However at the client side (Access VBA) I am getting the Type Mismatch
    error.
    This is the function (auto-generated by the web services reference tool ) in
    VBA that gives the error.

    Public Function wsm_GetIntArray() As Variant
    'Error Trap
    On Error GoTo wsm_GetIntArrayTrap

    wsm_GetIntArray = sc_GuidelinesService.GetIntArray()

    Exit Function
    wsm_GetIntArrayTrap:
    GuidelinesServiceErrorHandler "wsm_GetIntArray"
    End Function

    When i call my web method from a c# client, it works Ok.

    Any suggestion how how to fix this is welcome?
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News New Website 'empirefaithwar' To Map Sikh Experience In WWI Breaking News Jul 8, 2016
    Legal PIL: SC To Decide On Banning Sikh / Sardar Jokes Websites. Your Views? Breaking News Nov 12, 2015
    Leisure I designed website for the Gurudwara here! Business, Lifestyle & Leisure Aug 22, 2013
    Opinion Dusting The Web Breaking News May 24, 2013
    SciTech What Makes Video Go Viral? The Cult of Web Video Breaking News Dec 25, 2012

  3. Albert D.Kallal

    Albert D.Kallal
    Expand Collapse
    Guest

    Kind of funny you post your c# code. And, you even post the code generated
    by the VBA web add-in.

    However, you forget to post your few lines of code that fails? (am I missing
    something here???).

    Anyway.....

    What does the few lines of code that calls the GetIntArray in VBA look like?
    Notice that the "type" returned for that function is a variant. So, while it
    is called GetIntArrary, perhaps the variant type is still string, or even a
    "long" data type....


    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKallal@msn.com
    http://www.members.shaw.ca/AlbertKallal
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page