Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
New Contributor
Posts: 3
Registered: ‎11-10-2016

Error on getting OriginatingPipe from GRecordset

[ Edited ]

Hi,

 

i am developing a toolbar for GeoMedia 6.1. I have an attribute query in my workspace in GeoMedia that works fine using the GUI. Now i want to change the filter of this query. My code looks like this

 

If Not intCountPoint = 0 Then
            Try
                orpQueryPipe = rsQueryRecordsetP.GetExtension("OriginatingPipe")
            Catch ex As Exception
                SendToTracer(ex.Message)
            End Try
            If Not IsNothing(orpQueryPipe) Then
                orpQueryPipe.Filter = strWherePoint
            Else
                Try
                    afpAttributfilter = rsQueryRecordsetP.GetExtension("AttributFilterPipe")
                    If Not IsNothing(afpAttributfilter) Then
                        afpAttributfilter.Filter = strWherePoint
                    End If
                Catch ex As Exception
                    MsgBox("Die Abfrage ist nicht vom erwartetem Typ.", MsgBoxStyle.Exclamation, "Baumkataster Toolbar: Change Query")
                End Try
            End If
            Dim objNotification As PClient.Notification = rsQueryRecordsetP.GetExtension("Notification")
            SendToTracer("ChangeQuery: PunkteQuery Notification-Refresh")
            objNotification.Refresh()
            SendToTracer("ChangeQuery: PunkteQuery Notification-BroadcastMembershipChange")
            objNotification.BroadcastMembershipChange()

This works fine in another Toolbar but in this one i get the Error 'Ausnahme von HRESULT: 0x80040131' at the line

orpQueryPipe = rsQueryRecordsetP.GetExtension("OriginatingPipe")

The only difference is that in the functioning toolbar the db is an Oracle one and in the on that gets this error it is an SQL Spatial one.

 

Can anyone point me in the right direction to solve this? If you need more information just ask.

 

regards ABarth

Technical Evangelist
Posts: 532
Registered: ‎09-11-2015

Re: Error on getting OriginatingPipe from GRecordset

Hi ABarth,

 

the "OriginatingPipe" extension only exists if the recordset has been created via OriginatingPipe, which means if it comes from OriginatingPipe.OutpuRecordset. If it was created by another pipe, then an extension of the pipe name should exist. It looks like you (or whoever wrote that code) took into account that the recordset may come from another pipe, at least from AttributeFilterPipe.

 

It is difficult to say something more without knowing how the recordset has been created.

 

Pavel

New Contributor
Posts: 3
Registered: ‎11-10-2016

Re: Error on getting OriginatingPipe from GRecordset

[ Edited ]

Thanks for the quick reply.

I got the recordset from the query i created with the GUI.

 

Dim rsQueryRecordsetP As GDO.GRecordset = objGeoApp.Document.QueryFolder.QuerySubFolders("Queries").Queries("Abfrage_Baum").RecordSet

Or do you mean something else?

Staff
Posts: 294
Registered: ‎11-05-2015

Re: Error on getting OriginatingPipe from GRecordset

I think Pavel asked for the specifics of how the query was constructed.

Is this a similar query for when it works and when it doesn't? You already indicated that the warehouse connection is different. Would by any chance the Advanced Feature model be enabled on either, by chance?

Technical Evangelist
Posts: 532
Registered: ‎09-11-2015

Re: Error on getting OriginatingPipe from GRecordset

OK, it would be also good to know HOW did you create the query in GUI. What tool/command did you use?

New Contributor
Posts: 3
Registered: ‎11-10-2016

Re: Error on getting OriginatingPipe from GRecordset

[ Edited ]

Both were created by 'Attribute Query...' in the Menu 'Analysis'. But the working one was created on a View and the one that does not work is created on a layer of geocoded koordinates. Witch in it self is a Query, so ich presume that this is the cause for my error.

 

Now the question is how can i make my code work with the second query?

Highlighted
Technical Evangelist
Posts: 532
Registered: ‎09-11-2015

Re: Error on getting OriginatingPipe from GRecordset

OK, basically, if you create an attribute query on a feature class, GeoMedia creates an OriginatingPipe and put the attribute filter on the pipe. This means that the query to the database will contain where clause and the filtering would be faster in general. If you create an attribute query on another query, GeoMedia should create AttributeFilterPipe which means, that the filtering would be perfomed in GeoMedia memory and it will be slower.

 

This probably explains why the OriginatingPipe extension can be received in the firts case but not in the second one. However, your code should catch the exception and then go through the if-else statement and get the AttributeFilterPipe extension. Is there any problem with this part?

 

Pavel

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.