Re: returning multiple recordsets from VB to ASP

From: RufusGoofus (RufusGoofus_at_discussions.microsoft.com)
Date: 01/13/05


Date: Thu, 13 Jan 2005 08:59:04 -0800

I think we have good reasons for wanting to move complex logic out of the
stored procedure and into an intermediate VB DLL: (1) complex manipulation
of data is
more awkward to do in SQL than in VB and (2) the stored procedure is getting
constantly recompiled by SQL Server and we think that this problem is due to
the stored procedures use of numerous temporary tables and a big loop that
iterations through some involved logic. This is having a negative performance
impact. However, I do agree that there really is no need to return recordsets
to the ASP page. The ASP page anways puts the data into arrays, so I may
as well just return arrays. The one sure way of returning multiple arrays to
my ASP is to use the approach suggested by Christoph which is to create a
persistent object in my DLL and then have the ASP first invoke a method to
indirectly invoke the simplified stored procedure and then invoke a different
method mutliple times to retrieve each array. I tried passying dynamic
arrays by reference from my ASP to the VB DLL, but was getting compile-time
"type-mismatch" errors, so I abandoned that approach.

Thanks for all the suggestions. It's been a great help.

"Stephen Howe" wrote:

> > But you may want to rethink your design.
> > I would try and make the SP do the work and return the 4 rowsets as part
> > of
> > 1 recordset with your intermediate DLL doing as minimum adjustment as
> > possible.
>
> Just as a further footnote:
>
> If you say, "I do need to massage the results returned from the 4 rowsets,
> that is why I am constructing a Recordset in the intermediate DLL and
> returning that to the ASP".
>
> I would say: Don't bother. Recordsets have a lot of overhead. Instead I
> would transfer the 4 rowsets to VB Arrays of your own type, populate those
> and return those to the ASP. Returning arrays of user-defined types is
> simpler than creating Recordsets on the fly (at least that is what my
> instincts tell me - there may be some reason why this approach will not work
> but it is what I would attempt to do if I had lots of post processing to the
> rowsets to do)
>
> Stephen Howe
>
>
>
>



Relevant Pages

  • Re: returning multiple recordsets from VB to ASP
    ... I do agree that there really is no need to return recordsets> to the ASP page. ... The ASP page anways puts the data into arrays, so I may> as well just return arrays. ... The one sure way of returning multiple arrays to> my ASP is to use the approach suggested by Christoph which is to create a> persistent object in my DLL and then have the ASP first invoke a method to> indirectly invoke the simplified stored procedure and then invoke a different> method mutliple times to retrieve each array. ...
    (microsoft.public.data.ado)
  • Re: returning multiple recordsets from VB to ASP
    ... But, if my VB dll returns VB arrays to the ASP, then ... I can avoid constructing recordsets in my dll, ... The ASP page anways puts the data into arrays, ...
    (microsoft.public.data.ado)
  • Re: Call stored procedure from activex dll
    ... Porting any VBScript to a VB DLL is a straightforward process and has been ... work - business logic layer components, data access layer components, etc. ... > Everything works very well in my asp page. ... > How do I run the stored procedure from the dll? ...
    (microsoft.public.inetserver.asp.general)
  • Re: DLL from ASP Issue
    ... The dll is called to return a recordset with items from the DB. ... function calls a stored procedure which I have run seperately and it ... As far as the asp is concerned it is ...
    (microsoft.public.vb.general.discussion)
  • Re: can i load my own dlls into services.exe, if how
    ... ISAPI extensions and ISAPI filters can be useful. ... > DLL via JScript 'new ActiveXObject' or the VBscript equivalent in your ASP ...
    (microsoft.public.windowsce.app.development)