11-10-2016 04:10 AM - edited 11-10-2016 04:14 AM
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.
11-10-2016 04:39 AM
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.
11-10-2016 04:55 AM - edited 11-10-2016 04:56 AM
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?
11-10-2016 05:12 AM
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?
11-11-2016 12:01 AM - edited 11-11-2016 12:03 AM
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?
11-11-2016 03:29 AM
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?