Author Topic: Simple Query works fine in Search but not script  (Read 1361 times)

David Rains (bioform)

  • EA User
  • **
  • Posts: 83
  • Karma: +0/-0
    • View Profile
Simple Query works fine in Search but not script
« on: May 15, 2013, 02:12:26 pm »
strSQL = "SELECT t_object.ea_guid FROM t_object"
set c = Repository.GetElementSet(strSQL,2)
msgbox c.count

running the script that contains this fragment gives the DAO error:
DAO.fields [3265] item not found in this collection

Works fine in the query builder but not in my script?

Thanks,

David

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Simple Query works fine in Search but not scri
« Reply #1 on: May 15, 2013, 03:28:03 pm »
The query passed to GetElementSet need to return ElementIDs, not ElementGUIDs.  Try using the following query instead:

select t_object.Object_ID from t_object