rdoQueries collection DOES NOT WORK 
Author Message
 rdoQueries collection DOES NOT WORK

There was some small comment that this now works like DAO.  It appears
that you can add multiple items to an rdoQueries collection however it
is only storing the pointer to the object. I also found this extremely
irretating since I now have an array of about 100 rdoQuery objects
that I add one by one up front to my rdoConnection object.  

Charles Carlin

Quote:

>Here's some interesting tidbits I got from Microsoft about RDO 2.0.

>The rdoQueries collection does NOT work!  You can not populate the
>collection with rdoQueries and then refer to them later as you could with
>RDO 1.0 and the rdoPreparedStatements collection.  An rdoQuery is
>persistent only while it's within scope.  You must create the reference to
>it, use it and nuke it each time you wish to call a stored procedure.  No
>more prepping them for later use.

>Additionally Microsoft told me during the VB5 beta, when I pointed out that
>the rdoPreparedStatements syntax did not seem to be working, that the
>rdoPreparedStatement object and collection would be present in RDO 2.0.
>IT'S NOT!!!!! rdoPreparedStatements is not supported under RDO 2.0.  What
>does this mean....If you have code written using this object, you MUST
>convert it to the rdoQueries syntax; however, rdoQueries doesn't support
>populating the collection with multiple stored procedures.  This means that
>you(and I) will have to RECODE all of our apps.  Many thanks for Microsoft
>for telling us that the rdoPreparedStatements collection would be included
>in RDO 2.0, we made design decisions based on this, only to find out that
>they lied to us. :(

>If the rdoQueries collection worked as documented then it should be a small
>rewrite to convert your code.  However, if you did what we did and used the
>PreparedStatements collection, then you will have a major rewrite of your
>code to deal with.

>It's obvious that RDO 2.0 was released prematurely, all the documentation
>on it says that the rdoQueries collection should work like the old
>rdoPreparedStatements.  It even mentions the ADD method to add an rdoQuery
>to the collection, NONE OF THIS WORKS.  Microsoft told me that the
>documentation was wrong.  Seems to me that the RDO group was not able to
>get all of it working by the time they had to ship, so they just shipped.

>I asked if there were any issues that would stop me from using RDO 1.0 with
>VB5 and Microsoft told me that it would probably work, but would not be
>supported by them.

>IMHO this really sucks, Microsoft if your listening, please fix this.
>Release a patch for RDO 2.0 that fulfills your obligations to your
>developers.  Do not leave us stranded.

>Thanks
>--
>Brian Harris
>Sable Technology
>Microsoft Solutions Provider





Sun, 07 Nov 1999 03:00:00 GMT  
 rdoQueries collection DOES NOT WORK

Brian,

I don't know about you, but I have an app written in VB4 using RDO1.0 which
uses rdoPreparedStatements exclusively. I have no problems running that app
using VB5 and RDO 2.0

Niels
--
----------------------------------------------------------
Niels Berglund
Abaris TrueTime Solutions Ltd
London, UK
Phone: +44 181 740 0888

----------------------------------------------------------
----------------------------------------------------------

com>...

Quote:
>Here's some interesting tidbits I got from Microsoft about RDO 2.0.

>The rdoQueries collection does NOT work!  You can not populate the
>collection with rdoQueries and then refer to them later as you could with
>RDO 1.0 and the rdoPreparedStatements collection.  An rdoQuery is
>persistent only while it's within scope.  You must create the reference
to
>it, use it and nuke it each time you wish to call a stored procedure.  No
>more prepping them for later use.

>Additionally Microsoft told me during the VB5 beta, when I pointed out
that
>the rdoPreparedStatements syntax did not seem to be working, that the
>rdoPreparedStatement object and collection would be present in RDO 2.0.
>IT'S NOT!!!!! rdoPreparedStatements is not supported under RDO 2.0.  What
>does this mean....If you have code written using this object, you MUST
>convert it to the rdoQueries syntax; however, rdoQueries doesn't support
>populating the collection with multiple stored procedures.  This means
that
>you(and I) will have to RECODE all of our apps.  Many thanks for
Microsoft
>for telling us that the rdoPreparedStatements collection would be
included
>in RDO 2.0, we made design decisions based on this, only to find out that
>they lied to us. :(

>If the rdoQueries collection worked as documented then it should be a
small
>rewrite to convert your code.  However, if you did what we did and used
the
>PreparedStatements collection, then you will have a major rewrite of your
>code to deal with.

>It's obvious that RDO 2.0 was released prematurely, all the documentation
>on it says that the rdoQueries collection should work like the old
>rdoPreparedStatements.  It even mentions the ADD method to add an
rdoQuery
>to the collection, NONE OF THIS WORKS.  Microsoft told me that the
>documentation was wrong.  Seems to me that the RDO group was not able to
>get all of it working by the time they had to ship, so they just shipped.

>I asked if there were any issues that would stop me from using RDO 1.0
with
>VB5 and Microsoft told me that it would probably work, but would not be
>supported by them.

>IMHO this really sucks, Microsoft if your listening, please fix this.
>Release a patch for RDO 2.0 that fulfills your obligations to your
>developers.  Do not leave us stranded.

>Thanks
>--
>Brian Harris
>Sable Technology
>Microsoft Solutions Provider





Sun, 07 Nov 1999 03:00:00 GMT  
 rdoQueries collection DOES NOT WORK

Here's what you do.

First create an Interface class
' +++++++++++++++++++++++++++++++++++++++
Class:  ISql
        Public property Set Query(hQuery as rdoQuery)
        End Property

        Public property Get Query() as rdoQuery
        End Property
' +++++++++++++++++++++++++++++++++++++++

Create a wrapper class around a collection as done with VB5's class
builder, or you can just do it yourself.  Call this class CQuery which will
have a handle to your database through a reference to an rdoConnection.
Add these members

' +++++++++++++++++++++++++++++++++++++++
Class:  CQuery
Public Function GetQuery(hRefObject as ISql) as Boolean
        On Error GoTo ERROR_HANDLER
        Dim qID$:  qID = TypeOf (hRefObject)    'Returns the Class Name

        Set hRefObject.hQuery = mvarCol (qID)   'mvarCol is the collection in the
                                                                class
        GetQuery = True
Exit Function

ERROR_HANDLER:
        If err = ERROR_QUERY_NOT_FOUND then
                Set hRefObject.hQuery = CreateQuery (qID) Then
                Resume Next
        Else: GetQuery = False
        End If
End Function

Private Function CreateQuery(by val hQuery as string) as rdoQuery
        Select Case hQuery
                Case: ID_THIS_OBJECT
                        Set CreateQuery = rdoConnect.CreateQuery("Select...")
                        '  Set up Query and parameter info as needed
                Case: ID_THAT_OBJECT
                        'Do the same thing for that.
        End Select
        Call mvarCol.add (CreateQuery, hQuery)
End Function
' +++++++++++++++++++++++++++++++++++++++

Now, take a query you may need like a private member of a class.  The class
must Implement the ISql interface so all objects can be passed to recieve
it's query if a query has not been assigned to it.

' +++++++++++++++++++++++++++++++++++++++
Class:  Something
Implements ISql         'Implement the interface
Private mvarQuery as rdoQuery

Public Function Populate_Example() as Boolean
        If mvarQuery Is Nothing Then
                If Not CQuery.GetQuery(Me) Then  ' <-- **** Get Query
                        ' Raise Error or something
                        Exit Function
                End If
        End If

        'Set parameter values into rdoParameters of the rdoQuery
        Set rdoRS = mvarQuery.OpenResultset
        Populate_Example = True
End Function

Private Property Set ISql_Query(hQuery as rdoQuery)
        Set mvarQuery = hQuery
End Property
' +++++++++++++++++++++++++++++++++++++++

This is a little vague and I'm sure I may have left out a couple of things,
and you may be going about It a bit different than I.  But, this example
will only create what you need, and will only create it once!

I hope this helps,
Joel



Sun, 07 Nov 1999 03:00:00 GMT  
 rdoQueries collection DOES NOT WORK


Quote:

>Here's what you do.

>First create an Interface class

snip snip ...

This is a great solution to the collection problem but...
What we were really doing was setting up large stored procs in TempDb so
that when needed they would already have been transmitted, parsed, optimized,
compiled etc.  When the rdoQuery object reference goes out of scope the
query is dropped from TempDb regardless of whether it is in my collection
on my client.  The inability to add members to the rdoQueries collection
and manage the collection ourselves is a major problem.  In our case, we
can't just use permanent stored procs but must be able to dynamically
build complex queries to any of several databases and ideally have them
precompiled and ready to go.

While MS publicly states that they changed the collection behavior so that
rdo would be like DAO is probably true, I think that the real reason was
that so many people were not managing their collections and then complaining
of memory leaks from filling TempDb or their local swap files with orphaned
resources.  This was making the MS technology look bad and so they opted to
remove the ability to misuse the collection.



Sun, 07 Nov 1999 03:00:00 GMT  
 rdoQueries collection DOES NOT WORK

In your article you said  "This was making the MS technology look bad and
so they opted to remove the ability to misuse the collection."  This I
believe and it sucks that they would prevent people from doing something
because they don't know how to use it.  That is the programmer's
responsibility and Microsoft should point that out.  Hope things work out.

Regards,
Joel



Mon, 08 Nov 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. rdoQueries collection DOES NOT WORK

2. RdoQuery Drops From RdoQueries Collection

3. RdoQuery Drops From RdoQueries Collection

4. Herlp: LIKE in SQL doe not work anymore

5. combobox collection editor values not working

6. Contains method in Control Collection not working

7. Collection in ActiveX DLL (works in exe but not from ASP)

8. Sort method on Item Collection not working

9. retrieve item by collection key does not work

10. VB Collections - Accessing the collection, not the item.

11. Why VBA.Collection and Not VB.Collection?

12. What am I doing wrong with this Collection?

 

 
Powered by phpBB® Forum Software